Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reexecuting a Scala 3.3.1 cell with circe imports fails with an identifier expected, but 'export' found #1297

Open
aborg0 opened this issue Dec 21, 2023 · 4 comments

Comments

@aborg0
Copy link

aborg0 commented Dec 21, 2023

Scala 3 type level programming.zip
I used almond 0.14.0-RC14 with the attached notebook and when I re-execute the second cell, I receive:

-- [E040] Syntax Error: cell3.sc:113:2 -----------------------------------------
113 |  export,
    |  ^^^^^^
    |  an identifier expected, but 'export' found
    |
    | longer explanation available when compiling with `-explain`
Compilation Failed

It is possible that it is caused by some inspection which fails for the io.circe.export package (in Scala 3.3.1 export is a keyword). It is strange though that it does not happen first time, but it happens reproducibly afterwards. (I was not able to download the notebook with that execution as it resulted in 500 internal server error.)
image

(I have tried this from Windows 10 with WSL 2 with Ubuntu 20.04 LTS. Installed it with the following command: ./coursier launch --fork almond:0.14.0-RC14 --scala 3.3.1 -- --install, started the notebook server with jupyter notebook)

Server Information:

You are using Jupyter notebook.

The version of the notebook server is: 6.0.3
The server is running on this version of Python:

Python 3.8.10 (default, Nov 22 2023, 10:22:35) 
[GCC 9.4.0]

Current Kernel Information:

Almond 0.14.0-RC14
Ammonite 3.0.0-M0-56-1bcbe7f6
Scala library version 2.13.12 -- Copyright 2002-2023, LAMP/EPFL and Lightbend, Inc.
Java 1.8.0_392```
@coreyoconnor
Copy link
Contributor

Can confirm. What's interesting is the second execution does not need any circe references to fail. After evaluating once, the code can be replaced with:

println("odd")

and still fail with the same error

@coreyoconnor
Copy link
Contributor

I'm able to reproduce this on ammonite directly. This indicates an ammonite issue not one specific to almond.

Repro.

[~]$ cs launch ammonite --scala 3
Loading...
Welcome to the Ammonite Repl 3.0.0-M1-19-a7973e17 (Scala 3.3.3 Java 19.0.2)
@ import $ivy.`io.circe::circe-core:0.14.6` 
import $ivy.$                            

@ import io.circe.* 
import io.circe.*

@ {
  import io.circe.*
  println("ASD")
  } 
-- [E040] Syntax Error: cmd2.sc:52:2 -------------------------------------------
52 |  export,
   |  ^^^^^^
   |  an identifier expected, but 'export' found
   |
   | longer explanation available when compiling with `-explain`
Compilation Failed

@coreyoconnor
Copy link
Contributor

Filed com-lihaoyi/Ammonite#1487

@coreyoconnor
Copy link
Contributor

This has been fixed upstream in ammonite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants