-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
dotty crashes while compiling this file (its an invalid scala program) #20511
Comments
rfdzan
added
itype:bug
itype:crash
stat:needs triage
Every issue needs to have an "area" and "itype" label
labels
Jun 2, 2024
Gedochao
added
area:typer
and removed
stat:needs triage
Every issue needs to have an "area" and "itype" label
labels
Jun 3, 2024
Dunno about 2.12.19 (🤔), but it definitely crashes on 3.5.1-RC1-bin-20240602-c6fbe6f-NIGHTLY-git-c6fbe6f and 3.3.4-RC1-bin-20240326-feeddb7-NIGHTLY-git-feeddb7 |
Minimized example: package pakiet
def toppingPrice(size: Int): Double = ???
def crustPrice(crustType: Double): Double = ???
export toppingPrice, crustPrice Output: -- [E040] Syntax Error: ~/bugs/i20511.scala:9:19 -----------------------
9 |export toppingPrice, crustPrice
| ^
| '.' expected, but ',' found
-- [E040] Syntax Error: ~/bugs/i20511.scala:10:0 -----------------------
10 |
|^
|'.' expected, but eof found
exception occurred while typechecking ~/bugs/i20511.scala
An unhandled exception was thrown in the compiler.
Please file a crash report here:
https://github.com/scala/scala3/issues/new/choose
For non-enriched exceptions, compile with -Xno-enrich-error-messages.
while compiling: ~/bugs/i20511.scala
during phase: typer
mode: Mode(ImplicitsEnabled)
library version: version 2.13.14
compiler version: version 3.6.0-RC1-bin-20240710-466676c-NIGHTLY-git-466676c
settings: -classpath ~/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.6.0-RC1-bin-20240710-466676c-NIGHTLY/scala3-library_3-3.6.0-RC1-bin-20240710-466676c-NIGHTLY.jar:~/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.14/scala-library-2.13.14.jar -d ~/bugs/.scala-build/bugs_3200b05eac-f6fadb94cd/classes/main -java-output-version 11 -sourceroot ~/bugs
Exception in thread "main" java.lang.Error: internal error: closing over non-method <overloaded pakiet.$anonfun>, pos = <156..166>
at dotty.tools.dotc.typer.Typer.typedClosure(Typer.scala:1981)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:3447)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3520)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3597)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3601)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3712)
at dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:1419)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:3443)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3520)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3597)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3601)
at dotty.tools.dotc.typer.Typer.typedFunctionValue(Typer.scala:1896)
at dotty.tools.dotc.typer.Typer.typedFunction(Typer.scala:1635)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:3445)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3520)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3597)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3601)
at dotty.tools.dotc.typer.Typer.adaptNoArgsUnappliedMethod$1(Typer.scala:4318)
at dotty.tools.dotc.typer.Typer.adaptNoArgs$1(Typer.scala:4471)
at dotty.tools.dotc.typer.Typer.adapt1(Typer.scala:4703)
at dotty.tools.dotc.typer.Typer.adapt(Typer.scala:3975)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3597)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3601)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3712)
at dotty.tools.dotc.typer.Namer.typedAheadExpr$$anonfun$1(Namer.scala:1747)
at dotty.tools.dotc.typer.Namer.typedAhead(Namer.scala:1737)
at dotty.tools.dotc.typer.Namer.typedAheadExpr(Namer.scala:1747)
at dotty.tools.dotc.typer.Namer$ClassCompleter.exportForwarders(Namer.scala:1143)
at dotty.tools.dotc.typer.Namer$ClassCompleter.processExport$1(Namer.scala:1445)
at dotty.tools.dotc.typer.Namer$ClassCompleter.process$1(Namer.scala:1467)
at dotty.tools.dotc.typer.Namer$ClassCompleter.processExports(Namer.scala:1488)
at dotty.tools.dotc.typer.Namer$ClassCompleter.completeInCreationContext(Namer.scala:1712)
at dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:850)
at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:175)
at dotty.tools.dotc.core.Denotations$Denotation.completeInfo$1(Denotations.scala:190)
at dotty.tools.dotc.core.Denotations$Denotation.info(Denotations.scala:192)
at dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:393)
at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:3249)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:3469)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3520)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3597)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3601)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3712)
at dotty.tools.dotc.typer.TyperPhase.typeCheck$$anonfun$1(TyperPhase.scala:47)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at dotty.tools.dotc.core.Phases$Phase.monitor(Phases.scala:503)
at dotty.tools.dotc.typer.TyperPhase.typeCheck(TyperPhase.scala:53)
at dotty.tools.dotc.typer.TyperPhase.$anonfun$4(TyperPhase.scala:99)
at scala.collection.Iterator$$anon$6.hasNext(Iterator.scala:479)
at scala.collection.Iterator$$anon$9.hasNext(Iterator.scala:583)
at scala.collection.immutable.List.prependedAll(List.scala:152)
at scala.collection.immutable.List$.from(List.scala:685)
at scala.collection.immutable.List$.from(List.scala:682)
at scala.collection.IterableOps$WithFilter.map(Iterable.scala:900)
at dotty.tools.dotc.typer.TyperPhase.runOn(TyperPhase.scala:98)
at dotty.tools.dotc.Run.runPhases$1$$anonfun$1(Run.scala:343)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1323)
at dotty.tools.dotc.Run.runPhases$1(Run.scala:336)
at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:384)
at dotty.tools.dotc.Run.compileUnits$$anonfun$adapted$1(Run.scala:396)
at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:69)
at dotty.tools.dotc.Run.compileUnits(Run.scala:396)
at dotty.tools.dotc.Run.compileSources(Run.scala:282)
at dotty.tools.dotc.Run.compile(Run.scala:267)
at dotty.tools.dotc.Driver.doCompile(Driver.scala:37)
at dotty.tools.dotc.Driver.process(Driver.scala:201)
at dotty.tools.dotc.Driver.process(Driver.scala:169)
at dotty.tools.dotc.Driver.process(Driver.scala:181)
at dotty.tools.dotc.Driver.main(Driver.scala:211)
at dotty.tools.dotc.Main.main(Main.scala)
Compilation failed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compiler version
3.3.3
Minimized code
Output (click arrow to expand)
The text was updated successfully, but these errors were encountered: