Skip to content

NoSpan in console #9111

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

Closed
letalvoj opened this issue Jun 5, 2020 · 9 comments · Fixed by #11362
Closed

NoSpan in console #9111

letalvoj opened this issue Jun 5, 2020 · 9 comments · Fixed by #11362
Assignees
Milestone

Comments

@letalvoj
Copy link

letalvoj commented Jun 5, 2020

Minimized example

sbt:dotty-simple> console
[info] Fetching artifacts of 
https://repo1.maven.org/maven2/ch/epfl/lamp/dotty-compiler_0.25/0.25.0-bin-20200604-2fbefb0-NIGHTLY/dotty-compiler_0.25-0.25.…
  100.0% [##########] 11.9 MiB (104.6 KiB / s)
[info] Fetched artifacts of 
[info] Compiling 13 Scala sources to /Users/vletal/Workspace/Personal/loonyssh/target/scala-0.25/classes ...

scala> enum E:
     |   case A
     | 
[error] (run-main-0) java.lang.AssertionError: assertion failed
[error] java.lang.AssertionError: assertion failed
[error]         at dotty.DottyPredef$.assertFail(DottyPredef.scala:16)
[error]         at dotty.tools.dotc.util.Spans$Span$.point$extension(Spans.scala:56)
[error]         at dotty.tools.dotc.util.SourcePosition.point(SourcePosition.scala:23)
[error]         at dotty.tools.dotc.util.SourcePosition.line(SourcePosition.scala:25)
[error]         at dotty.tools.repl.ReplDriver.$anonfun$5(ReplDriver.scala:258)
[error]         at scala.math.Ordering$$anon$1.compare(Ordering.scala:140)
[error]         at java.base/java.util.TimSort.countRunAndMakeAscending(TimSort.java:355)
[error]         at java.base/java.util.TimSort.sort(TimSort.java:220)
[error]         at java.base/java.util.Arrays.sort(Arrays.java:1441)
[error]         at scala.collection.SeqOps.sorted(Seq.scala:703)
[error]         at scala.collection.SeqOps.sorted$(Seq.scala:695)
[error]         at scala.collection.immutable.List.scala$collection$immutable$StrictOptimizedSeqOps$$super$sorted(List.scala:79)
@letalvoj letalvoj changed the title Error compiling an enum in console java.lang.AssertionError in console Jun 5, 2020
@bishabosha
Copy link
Member

bishabosha commented Jun 5, 2020

Hi, I tried this on Mac with a new sbt project and dotty 0.25.0-bin-20200604-2fbefb0-NIGHTLY, sbt 1.3.12 using graalvm jdk 8 version 20.0 CE and then AdoptOpenJDK 14.0.1+7. I can't replicate this so please may you provide more information?

@bishabosha
Copy link
Member

bishabosha commented Jun 5, 2020

@letalvoj I see you are compiling 13 sources, perhaps there is some weird interaction. It would be useful if you can see if deleting those files makes a difference, and if so then what is the minimum set of files that cause this issue

@bishabosha bishabosha changed the title java.lang.AssertionError in console NoSpan in console Jun 7, 2020
@letalvoj
Copy link
Author

letalvoj commented Jun 8, 2020

@bishabosha will do in the upcoming days, sorry for the delay

@bishabosha
Copy link
Member

@letalvoj no need to apologise 😀

@nicolasstucki
Copy link
Contributor

We made some fixed on that logic recently. It might have fixed it.

@letalvoj
Copy link
Author

Soooo after stripping my project to bare bones I realized that I have a

scalacOptions in (Compile, console) += "-Xprint:typer"

in build.sbt. It works on 0.24.0-RC1.

@bishabosha
Copy link
Member

bishabosha commented Jun 11, 2020

ok thank you, confirmed the lampepfl/dotty.g8 template with version 0.25.0-bin-20200604-2fbefb0-NIGHTLY and scalacOptions in (Compile, console) += "-Xprint:typer" will fail with the given crash in console

@bishabosha
Copy link
Member

it still crashes on 0.25.0-RC1

@letalvoj
Copy link
Author

letalvoj commented Jun 11, 2020

scalacOptions += "-verbose"

also causes this issue

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

Successfully merging a pull request may close this issue.

4 participants