-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Lazy enums. #5034
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
Comments
…zy instead of crash
Crashes for |
Prevents the compiler from crashing, and returns error instead
Prevents the compiler from crashing, and returns error instead
this still crashes with the same error: lazy enum i0 { case A } |
Well, is help wanted for this issue? Glad to contribute. Or at least try to tackle it. |
@BluePat PR's are always welcome :), at the very least there should should a sensible user facing error before the assertion crash, probably before/in |
@bishabosha, @allanrenucci, thanks for the tips. I'll take them into consideration. |
Same crash: erased enum |
Similar crash: enum A
sealed abstract case Stack trace-- [E040] Syntax Error: testing/Test.scala:2:0 ---------------------------------
2 |sealed abstract case
|^^^^^^
|'{' expected, but 'end of statement' found
-- [E040] Syntax Error: testing/Test.scala:2:20 --------------------------------
2 |sealed abstract case
| ^
| an identifier expected, but eof found
-- Error: testing/Test.scala:2:7 -----------------------------------------------
2 |sealed abstract case
| ^^^^^^^^
| abstract modifier cannot be used for objects
exception occurred while typechecking testing/Test.scala
exception occurred while compiling testing/Test.scala
java.lang.AssertionError: assertion failed: illegal flagset combination: sealed case abstract <enum> and <stable> <enum> while compiling testing/Test.scala
Exception in thread "main" java.lang.AssertionError: assertion failed: illegal flagset combination: sealed case abstract <enum> and <stable> <enum>
at dotty.DottyPredef$.assertFail(DottyPredef.scala:17)
at dotty.tools.dotc.core.Flags$given_bits_of_FlagSet$.$bar(Flags.scala:40)
at dotty.tools.dotc.ast.untpd$Modifiers.$bar(untpd.scala:216)
at dotty.tools.dotc.ast.DesugarEnums$.expandSimpleEnumCase(DesugarEnums.scala:307)
at dotty.tools.dotc.ast.DesugarEnums$.expandEnumModule(DesugarEnums.scala:284)
at dotty.tools.dotc.ast.desugar$.moduleDef(Desugar.scala:886)
at dotty.tools.dotc.ast.desugar$.defTree(Desugar.scala:1187)
at dotty.tools.dotc.typer.Namer.expand(Namer.scala:484)
at dotty.tools.dotc.typer.Namer.index$$anonfun$1(Namer.scala:765)
at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.immutable.List.foreach(List.scala:305)
at dotty.tools.dotc.typer.Namer.index(Namer.scala:765)
at dotty.tools.dotc.typer.Namer$ClassCompleter.completeConstructor(Namer.scala:1133)
at dotty.tools.dotc.typer.Namer$ClassCompleter.completeInCreationContext(Namer.scala:1208)
at dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:843)
at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:258)
at dotty.tools.dotc.core.Denotations$Denotation.completeInfo$1(Denotations.scala:185)
at dotty.tools.dotc.core.Denotations$Denotation.info(Denotations.scala:187)
at dotty.tools.dotc.core.Types$NamedType.info(Types.scala:1930)
at dotty.tools.dotc.core.Types$NamedType.withDenot(Types.scala:2284)
at dotty.tools.dotc.core.Types$TypeRef$.apply(Types.scala:2473)
at dotty.tools.dotc.core.Types$NamedType$.apply(Types.scala:2447)
at dotty.tools.dotc.core.Types$Type.select(Types.scala:1377)
at dotty.tools.dotc.typer.Typer.loop$2(Typer.scala:299)
at dotty.tools.dotc.typer.Typer.findRefRecur$1(Typer.scala:345)
at dotty.tools.dotc.typer.Typer.findRef(Typer.scala:348)
at dotty.tools.dotc.typer.Typer.typedIdent(Typer.scala:399)
at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2098)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2176)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2213)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2225)
at dotty.tools.dotc.typer.Typer.typedType(Typer.scala:2335)
at dotty.tools.dotc.typer.Typer.typedValDef(Typer.scala:1585)
at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2103)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2176)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2213)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2225)
at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2247)
at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2291)
at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:1910)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2150)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2177)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2213)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2225)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2333)
at dotty.tools.dotc.typer.FrontEnd.liftedTree1$2(FrontEnd.scala:78)
at dotty.tools.dotc.typer.FrontEnd.typeCheck$$anonfun$1(FrontEnd.scala:83)
at dotty.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at dotty.tools.dotc.typer.FrontEnd.monitor(FrontEnd.scala:42)
at dotty.tools.dotc.typer.FrontEnd.typeCheck(FrontEnd.scala:84)
at dotty.tools.dotc.typer.FrontEnd.runOn$$anonfun$3(FrontEnd.scala:114)
at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.immutable.List.foreach(List.scala:305)
at dotty.tools.dotc.typer.FrontEnd.runOn(FrontEnd.scala:114)
at dotty.tools.dotc.Run.runPhases$4$$anonfun$4(Run.scala:161)
at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1323)
at dotty.tools.dotc.Run.runPhases$5(Run.scala:171)
at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:179)
at dotty.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:65)
at dotty.tools.dotc.Run.compileUnits(Run.scala:186)
at dotty.tools.dotc.Run.compileSources(Run.scala:123)
at dotty.tools.dotc.Run.compile(Run.scala:106)
at dotty.tools.dotc.Driver.doCompile(Driver.scala:36)
at dotty.tools.dotc.Driver.process(Driver.scala:189)
at dotty.tools.dotc.Driver.process(Driver.scala:158)
at dotty.tools.dotc.Driver.process(Driver.scala:170)
at dotty.tools.dotc.Driver.main(Driver.scala:197)
at dotty.tools.dotc.Main.main(Main.scala) |
Fixed in #7850 |
Uh oh!
There was an error while loading. Please reload this page.
It would be great if there were
lazy enum
s with the following encoding:But in the meantime, here is a crash:
AE-2251401fe4c14de0510247ea75752a42fcfb237a
The text was updated successfully, but these errors were encountered: