Closed
Description
I guess there's no such thing as a "sealed object" but writing this into the REPL:
scala> sealed object Fun
kills the REPL with this:
Exception in thread "main" java.lang.AssertionError: assertion failed: illegal flagset combination: sealed module and final lazy module <stable>
at dotty.DottyPredef$.assertFail(DottyPredef.scala:39)
at dotty.tools.dotc.core.Flags$FlagSet$.$bar$extension(Flags.scala:26)
at dotty.tools.dotc.ast.untpd$Modifiers.$bar(untpd.scala:163)
at dotty.tools.dotc.ast.desugar$.moduleDef(Desugar.scala:581)
at dotty.tools.dotc.ast.desugar$.defTree(Desugar.scala:695)
at dotty.tools.dotc.typer.Namer.expand(Namer.scala:367)
at dotty.tools.dotc.typer.Namer.index$$anonfun$1(Namer.scala:639)
at scala.compat.java8.JProcedure1.apply(JProcedure1.java:18)
at scala.compat.java8.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.immutable.List.foreach(List.scala:389)
at dotty.tools.dotc.typer.Namer.index(Namer.scala:639)
at dotty.tools.dotc.typer.Namer.indexAndAnnotate(Namer.scala:716)
at dotty.tools.dotc.typer.Namer$ClassCompleter.completeInCreationContext(Namer.scala:911)
at dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:758)
at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:241)
at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeInfo$1(SymDenotations.scala:204)
at dotty.tools.dotc.core.SymDenotations$SymDenotation.info(SymDenotations.scala:206)
at dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:347)
at dotty.tools.dotc.core.SymDenotations$SymDenotation.isAbsent(SymDenotations.scala:453)
at dotty.tools.dotc.typer.TypeAssigner.reallyExists(TypeAssigner.scala:160)
at dotty.tools.dotc.typer.Typer.qualifies$1(Typer.scala:131)
at dotty.tools.dotc.typer.Typer.loop$1(Typer.scala:272)
at dotty.tools.dotc.typer.Typer.findRef$1(Typer.scala:334)
at dotty.tools.dotc.typer.Typer.op$1(Typer.scala:353)
at dotty.tools.dotc.typer.Typer.typedIdent(Typer.scala:102)
at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:1622)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1688)
at dotty.tools.dotc.typer.Typer.op$40(Typer.scala:1706)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1702)
at dotty.tools.dotc.typer.Typer.typedType(Typer.scala:1765)
at dotty.tools.dotc.typer.Typer.op$33(Typer.scala:1254)
at dotty.tools.dotc.typer.Typer.typedValDef(Typer.scala:1251)
at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:1627)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1688)
at dotty.tools.dotc.typer.Typer.op$40(Typer.scala:1706)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1702)
at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:1728)
at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:1751)
at dotty.tools.dotc.typer.Typer.op$38(Typer.scala:1528)
at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:1515)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1672)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1689)
at dotty.tools.dotc.typer.Typer.op$40(Typer.scala:1706)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1702)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:1763)
at dotty.tools.dotc.typer.FrontEnd.typeCheck$$anonfun$1(FrontEnd.scala:64)
at scala.compat.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at dotty.tools.dotc.typer.FrontEnd.monitor(FrontEnd.scala:32)
at dotty.tools.dotc.typer.FrontEnd.typeCheck(FrontEnd.scala:68)
at dotty.tools.repl.REPLFrontEnd.runOn$$anonfun$2(ReplFrontEnd.scala:27)
at scala.compat.java8.JProcedure1.apply(JProcedure1.java:18)
at scala.compat.java8.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.immutable.List.foreach(List.scala:389)
at dotty.tools.repl.REPLFrontEnd.runOn(ReplFrontEnd.scala:27)
at dotty.tools.dotc.Run.op$4(Run.scala:125)
at dotty.tools.dotc.Run.runPhases$1$$anonfun$1(Run.scala:123)
at scala.compat.java8.JProcedure1.apply(JProcedure1.java:18)
at scala.compat.java8.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.IndexedSeqOptimized.foreach(IndexedSeqOptimized.scala:32)
at scala.collection.IndexedSeqOptimized.foreach$(IndexedSeqOptimized.scala:29)
at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:191)
at dotty.tools.dotc.Run.runPhases$2(Run.scala:136)
at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:141)
at scala.compat.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:86)
at dotty.tools.dotc.Run.compileUnits(Run.scala:143)
at dotty.tools.dotc.Run.compileUnits(Run.scala:99)
at dotty.tools.repl.ReplCompiler.runCompilation(ReplCompiler.scala:187)
at dotty.tools.repl.ReplCompiler.compile$$anonfun$3$$anonfun$2(ReplCompiler.scala:197)
at scala.util.Either.flatMap(Either.scala:338)
at dotty.tools.repl.ReplCompiler.compile$$anonfun$1(ReplCompiler.scala:198)
at scala.util.Either.flatMap(Either.scala:338)
at dotty.tools.repl.ReplCompiler.compile(ReplCompiler.scala:198)
at dotty.tools.repl.ReplDriver.compile(ReplDriver.scala:217)
at dotty.tools.repl.ReplDriver.interpret(ReplDriver.scala:190)
at dotty.tools.repl.ReplDriver.runUntilQuit(ReplDriver.scala:143)
at dotty.tools.repl.Main$.main(Main.scala:6)
at dotty.tools.repl.Main.main(Main.scala)