Skip to content

assertion error in typer with 0.1.2-RC1 #2672

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
rkuhn opened this issue Jun 3, 2017 · 6 comments · Fixed by #2892
Closed

assertion error in typer with 0.1.2-RC1 #2672

rkuhn opened this issue Jun 3, 2017 · 6 comments · Fixed by #2892

Comments

@rkuhn
Copy link

rkuhn commented Jun 3, 2017

On this file dotc bails out with the assertion error below. Commenting out lines 135–142 changes the behavior to an assertion error in ScalaDSL.scala.

> launchIDE
[info] Compiling 10 Scala sources to /Users/rkuhn/comp/akka-typed-session/target/scala-0.1/classes...
[info] 
[info] exception occurred while typechecking /Users/rkuhn/comp/akka-typed-session/src/main/scala/com/rolandkuhn/akka_typed_session/FSM.scala
[info] 
[info] exception occurred while compiling /Users/rkuhn/comp/akka-typed-session/src/main/scala/com/rolandkuhn/akka_typed_session/Actor.scala, /Users/rkuhn/comp/akka-typed-session/src/main/scala/com/rolandkuhn/akka_typed_session/Effects.scala, /Users/rkuhn/comp/akka-typed-session/src/main/scala/com/rolandkuhn/akka_typed_session/FSM.scala, /Users/rkuhn/comp/akka-typed-session/src/main/scala/com/rolandkuhn/akka_typed_session/MapAdapter.scala, /Users/rkuhn/comp/akka-typed-session/src/main/scala/com/rolandkuhn/akka_typed_session/Operation.scala, /Users/rkuhn/comp/akka-typed-session/src/main/scala/com/rolandkuhn/akka_typed_session/Process.scala, /Users/rkuhn/comp/akka-typed-session/src/main/scala/com/rolandkuhn/akka_typed_session/ScalaDSL.scala, /Users/rkuhn/comp/akka-typed-session/src/main/scala/com/rolandkuhn/akka_typed_session/State.scala, /Users/rkuhn/comp/akka-typed-session/src/main/scala/com/rolandkuhn/akka_typed_session/internal/ProcessImpl.scala, /Users/rkuhn/comp/akka-typed-session/src/main/scala/com/rolandkuhn/akka_typed_session/package.scala
[trace] Stack trace suppressed: run last compile:compileIncremental for the full output.
[error] (compile:compileIncremental) java.lang.AssertionError: assertion failed
[error] Total time: 1 s, completed 2017-jun-03 20:51:00

The full stack trace:

java.lang.AssertionError: assertion failed
	at scala.Predef$.assert(Predef.scala:156)
	at dotty.tools.dotc.typer.Applications$Application.init(Applications.scala:234)
	at dotty.tools.dotc.typer.Applications$TypedApply.<init>(Applications.scala:534)
	at dotty.tools.dotc.typer.Applications$ApplyToUntyped.<init>(Applications.scala:615)
	at dotty.tools.dotc.typer.Applications.simpleApply$1(Applications.scala:671)
	at dotty.tools.dotc.typer.Applications.op$64$$anonfun$2(Applications.scala:696)
	at dotty.tools.dotc.typer.Typer.tryEither(Typer.scala:1691)
	at dotty.tools.dotc.typer.Applications.op$64(Applications.scala:707)
	at dotty.tools.dotc.typer.Applications.realApply$1(Applications.scala:641)
	at dotty.tools.dotc.typer.Applications.typedApply(Applications.scala:741)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1568)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1614)
	at dotty.tools.dotc.typer.Typer.op$116(Typer.scala:1629)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1627)
	at dotty.tools.dotc.typer.Namer.typedAheadExpr$$anonfun$1(Namer.scala:934)
	at dotty.tools.dotc.typer.Namer.typedAheadImpl(Namer.scala:924)
	at dotty.tools.dotc.typer.Namer.typedAheadExpr(Namer.scala:934)
	at dotty.tools.dotc.typer.Namer.valOrDefDefSig(Namer.scala:1081)
	at dotty.tools.dotc.typer.Namer.defDefSig(Namer.scala:1145)
	at dotty.tools.dotc.typer.Namer$Completer.typeSig(Namer.scala:733)
	at dotty.tools.dotc.typer.Namer$Completer.completeInCreationContext(Namer.scala:777)
	at dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:755)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:221)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.info(SymDenotations.scala:199)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:338)
	at dotty.tools.dotc.typer.Typer.retrieveSym(Typer.scala:1521)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:1546)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1613)
	at dotty.tools.dotc.typer.Typer.op$116(Typer.scala:1629)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1627)
	at dotty.tools.dotc.typer.Typer.traverse$4(Typer.scala:1651)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:1671)
	at dotty.tools.dotc.typer.Typer.typedBlockStats(Typer.scala:614)
	at dotty.tools.dotc.typer.Typer.op$99(Typer.scala:617)
	at dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:616)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1575)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1614)
	at dotty.tools.dotc.typer.Typer.op$116(Typer.scala:1629)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1627)
	at dotty.tools.dotc.typer.Typer.op$109(Typer.scala:805)
	at dotty.tools.dotc.typer.Typer.typedFunction(Typer.scala:687)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1577)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1614)
	at dotty.tools.dotc.typer.ProtoTypes$FunProto.$anonfun$975(ProtoTypes.scala:237)
	at dotty.tools.dotc.typer.ProtoTypes$FunProto.cacheTypedArg(ProtoTypes.scala:215)
	at dotty.tools.dotc.typer.ProtoTypes$FunProto.typedArg(ProtoTypes.scala:237)
	at dotty.tools.dotc.typer.Applications$ApplyToUntyped.typedArg(Applications.scala:616)
	at dotty.tools.dotc.typer.Applications$ApplyToUntyped.typedArg(Applications.scala:616)
	at dotty.tools.dotc.typer.Applications$Application.addTyped$1(Applications.scala:399)
	at dotty.tools.dotc.typer.Applications$Application.matchArgs(Applications.scala:444)
	at dotty.tools.dotc.typer.Applications$Application.init(Applications.scala:238)
	at dotty.tools.dotc.typer.Applications$TypedApply.<init>(Applications.scala:534)
	at dotty.tools.dotc.typer.Applications$ApplyToUntyped.<init>(Applications.scala:615)
	at dotty.tools.dotc.typer.Applications.simpleApply$1(Applications.scala:671)
	at dotty.tools.dotc.typer.Applications.op$64$$anonfun$2(Applications.scala:696)
	at dotty.tools.dotc.typer.Typer.tryEither(Typer.scala:1691)
	at dotty.tools.dotc.typer.Applications.op$64(Applications.scala:707)
	at dotty.tools.dotc.typer.Applications.realApply$1(Applications.scala:641)
	at dotty.tools.dotc.typer.Applications.typedApply(Applications.scala:741)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1568)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1614)
	at dotty.tools.dotc.typer.Typer.op$116(Typer.scala:1629)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1627)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:1683)
	at dotty.tools.dotc.typer.Typer.typeSelectOnTerm$1(Typer.scala:393)
	at dotty.tools.dotc.typer.Typer.op$83(Typer.scala:427)
	at dotty.tools.dotc.typer.Typer.typedSelect(Typer.scala:391)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:1549)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1613)
	at dotty.tools.dotc.typer.Typer.op$116(Typer.scala:1629)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1627)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:1683)
	at dotty.tools.dotc.typer.Applications.op$64(Applications.scala:643)
	at dotty.tools.dotc.typer.Applications.realApply$1(Applications.scala:641)
	at dotty.tools.dotc.typer.Applications.typedApply(Applications.scala:741)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1568)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1614)
	at dotty.tools.dotc.typer.Typer.op$116(Typer.scala:1629)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1627)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:1683)
	at dotty.tools.dotc.typer.Typer.typeSelectOnTerm$1(Typer.scala:393)
	at dotty.tools.dotc.typer.Typer.op$83(Typer.scala:427)
	at dotty.tools.dotc.typer.Typer.typedSelect(Typer.scala:391)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:1549)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1613)
	at dotty.tools.dotc.typer.Typer.op$116(Typer.scala:1629)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1627)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:1683)
	at dotty.tools.dotc.typer.Applications.op$64(Applications.scala:643)
	at dotty.tools.dotc.typer.Applications.realApply$1(Applications.scala:641)
	at dotty.tools.dotc.typer.Applications.typedApply(Applications.scala:741)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1568)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1614)
	at dotty.tools.dotc.typer.Typer.op$116(Typer.scala:1629)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1627)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:1683)
	at dotty.tools.dotc.typer.Typer.typeSelectOnTerm$1(Typer.scala:393)
	at dotty.tools.dotc.typer.Typer.op$83(Typer.scala:427)
	at dotty.tools.dotc.typer.Typer.typedSelect(Typer.scala:391)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:1549)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1613)
	at dotty.tools.dotc.typer.Typer.op$116(Typer.scala:1629)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1627)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:1683)
	at dotty.tools.dotc.typer.Typer.op$99(Typer.scala:624)
	at dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:616)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1575)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1614)
	at dotty.tools.dotc.typer.Typer.op$116(Typer.scala:1629)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1627)
	at dotty.tools.dotc.typer.Namer.typedAheadExpr$$anonfun$1(Namer.scala:934)
	at dotty.tools.dotc.typer.Namer.typedAheadImpl(Namer.scala:924)
	at dotty.tools.dotc.typer.Namer.typedAheadExpr(Namer.scala:934)
	at dotty.tools.dotc.typer.Namer.valOrDefDefSig(Namer.scala:1081)
	at dotty.tools.dotc.typer.Namer.defDefSig(Namer.scala:1145)
	at dotty.tools.dotc.typer.Namer$Completer.typeSig(Namer.scala:733)
	at dotty.tools.dotc.typer.Namer$Completer.completeInCreationContext(Namer.scala:777)
	at dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:755)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:221)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.info(SymDenotations.scala:199)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:338)
	at dotty.tools.dotc.typer.Typer.retrieveSym(Typer.scala:1521)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:1546)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1613)
	at dotty.tools.dotc.typer.Typer.op$116(Typer.scala:1629)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1627)
	at dotty.tools.dotc.typer.Typer.traverse$4(Typer.scala:1651)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:1671)
	at dotty.tools.dotc.typer.Typer.typedBlockStats(Typer.scala:614)
	at dotty.tools.dotc.typer.Typer.op$99(Typer.scala:617)
	at dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:616)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1575)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1614)
	at dotty.tools.dotc.typer.Typer.op$116(Typer.scala:1629)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1627)
	at dotty.tools.dotc.typer.Typer.op$109(Typer.scala:805)
	at dotty.tools.dotc.typer.Typer.typedFunction(Typer.scala:687)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1577)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1614)
	at dotty.tools.dotc.typer.Typer.op$116(Typer.scala:1629)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1627)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:1683)
	at dotty.tools.dotc.typer.Typer.op$99(Typer.scala:624)
	at dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:616)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1575)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1614)
	at dotty.tools.dotc.typer.ProtoTypes$FunProto.$anonfun$975(ProtoTypes.scala:237)
	at dotty.tools.dotc.typer.ProtoTypes$FunProto.cacheTypedArg(ProtoTypes.scala:215)
	at dotty.tools.dotc.typer.ProtoTypes$FunProto.typedArg(ProtoTypes.scala:237)
	at dotty.tools.dotc.typer.Applications$ApplyToUntyped.typedArg(Applications.scala:616)
	at dotty.tools.dotc.typer.Applications$ApplyToUntyped.typedArg(Applications.scala:616)
	at dotty.tools.dotc.typer.Applications$Application.addTyped$1(Applications.scala:399)
	at dotty.tools.dotc.typer.Applications$Application.matchArgs(Applications.scala:444)
	at dotty.tools.dotc.typer.Applications$Application.init(Applications.scala:238)
	at dotty.tools.dotc.typer.Applications$TypedApply.<init>(Applications.scala:534)
	at dotty.tools.dotc.typer.Applications$ApplyToUntyped.<init>(Applications.scala:615)
	at dotty.tools.dotc.typer.Applications.simpleApply$1(Applications.scala:671)
	at dotty.tools.dotc.typer.Applications.op$64$$anonfun$2(Applications.scala:696)
	at dotty.tools.dotc.typer.Typer.tryEither(Typer.scala:1691)
	at dotty.tools.dotc.typer.Applications.op$64(Applications.scala:707)
	at dotty.tools.dotc.typer.Applications.realApply$1(Applications.scala:641)
	at dotty.tools.dotc.typer.Applications.typedApply(Applications.scala:741)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1568)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1614)
	at dotty.tools.dotc.typer.Typer.op$116(Typer.scala:1629)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1627)
	at dotty.tools.dotc.typer.Typer.traverse$4(Typer.scala:1662)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:1671)
	at dotty.tools.dotc.typer.Typer.op$106(Typer.scala:1357)
	at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:1283)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:1559)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1613)
	at dotty.tools.dotc.typer.Typer.op$116(Typer.scala:1629)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1627)
	at dotty.tools.dotc.typer.Typer.traverse$4(Typer.scala:1651)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:1671)
	at dotty.tools.dotc.typer.Typer.op$86(Typer.scala:1474)
	at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:1461)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1598)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1614)
	at dotty.tools.dotc.typer.Typer.op$116(Typer.scala:1629)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1627)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:1683)
	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.dotc.typer.FrontEnd.runOn$$anonfun$3(FrontEnd.scala:93)
	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:392)
	at dotty.tools.dotc.typer.FrontEnd.runOn(FrontEnd.scala:93)
	at dotty.tools.dotc.Run.$anonfun$$anonfun$10(Run.scala:82)
	at scala.compat.java8.JProcedure1.apply(JProcedure1.java:18)
	at scala.compat.java8.JProcedure1.apply(JProcedure1.java:10)
	at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
	at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186)
	at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:90)
	at scala.compat.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
	at dotty.tools.dotc.util.Stats$.monitorHeartBeat(Stats.scala:76)
	at dotty.tools.dotc.Run.compileUnits(Run.scala:95)
	at dotty.tools.dotc.Run.compileSources(Run.scala:64)
	at dotty.tools.dotc.Run.compile(Run.scala:48)
	at dotty.tools.dotc.Driver.doCompile(Driver.scala:26)
	at dotty.tools.dotc.Driver.process(Driver.scala:124)
	at xsbt.CachedCompilerImpl.run(CompilerInterface.scala:63)
	at xsbt.CachedCompilerImpl.run(CompilerInterface.scala:53)
	at xsbt.CompilerInterface.run(CompilerInterface.scala:37)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:107)
	at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:53)
	at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:47)
	at sbt.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply$mcV$sp(MixedAnalyzingCompiler.scala:50)
	at sbt.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply(MixedAnalyzingCompiler.scala:50)
	at sbt.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply(MixedAnalyzingCompiler.scala:50)
	at sbt.compiler.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:74)
	at sbt.compiler.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:49)
	at sbt.compiler.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:64)
	at sbt.compiler.IC$$anonfun$compileInternal$1.apply(IncrementalCompiler.scala:160)
	at sbt.compiler.IC$$anonfun$compileInternal$1.apply(IncrementalCompiler.scala:160)
	at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:66)
	at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:64)
	at sbt.inc.IncrementalCommon.cycle(IncrementalCommon.scala:32)
	at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:72)
	at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:71)
	at sbt.inc.Incremental$.manageClassfiles(Incremental.scala:99)
	at sbt.inc.Incremental$.compile(Incremental.scala:71)
	at sbt.inc.IncrementalCompile$.apply(Compile.scala:54)
	at sbt.compiler.IC$.compileInternal(IncrementalCompiler.scala:160)
	at sbt.compiler.IC$.incrementalCompile(IncrementalCompiler.scala:138)
	at sbt.Compiler$.compile(Compiler.scala:155)
	at sbt.Compiler$.compile(Compiler.scala:141)
	at sbt.Defaults$.sbt$Defaults$$compileIncrementalTaskImpl(Defaults.scala:886)
	at sbt.Defaults$$anonfun$compileIncrementalTask$1.apply(Defaults.scala:877)
	at sbt.Defaults$$anonfun$compileIncrementalTask$1.apply(Defaults.scala:875)
	at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
	at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
	at sbt.std.Transform$$anon$4.work(System.scala:63)
	at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
	at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
	at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
	at sbt.Execute.work(Execute.scala:237)
	at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
	at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
	at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
	at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:748)
@smarter
Copy link
Member

smarter commented Jun 3, 2017

Hi @rkuhn ! A quick look tells me that this isn't going to be easy to figure out. If you have the time, could you try to minimize the crash to a single file? It would help a lot!

@rkuhn
Copy link
Author

rkuhn commented Jun 3, 2017

While not surprising, I still had hope that the location of the crash would tell you something :-) I guess I’ll have to rebuild akka-typed-session from the ground up to minimize this, so I cannot promise a timeframe.

@rkuhn
Copy link
Author

rkuhn commented Jun 3, 2017

Okay, managed to make it smaller. Use lampepfl/dotty.g8 with the following in Main.scala:

sealed trait Effect
sealed trait Effects
sealed abstract class HNil extends Effects
sealed abstract class ::[+H <: Effect, +T <: Effects] extends Effects
sealed abstract class Loop[+E <: Effects] extends Effects

object ops {
    sealed trait Prepend[First <: Effects, Second <: Effects] {
      type Out <: Effects
    }
    type PrependAux[F <: Effects, S <: Effects, O <: Effects] = Prepend[F, S] { type Out = O }

    sealed trait PrependLowLow {
      implicit def prepend[H <: Effect, T <: Effects, S <: Effects](
        implicit ev: Prepend[T, S]): PrependAux[H :: T, S, H :: ev.Out] = null
    }
    sealed trait PrependLow extends PrependLowLow {
      implicit def prependNil[F <: HNil, S <: Effects]: PrependAux[F, S, S] = null
    }
    object Prepend extends PrependLow {
      implicit def prependToNil[F <: Effects, S <: HNil]: PrependAux[F, S, F] = null
    }
}

object Main {

  trait Op[S, +T, E <: Effects] {
    def flatMap[U, EE <: Effects](f: T => Op[S, U, EE])(implicit ev: ops.Prepend[E, EE]): Op[S, U, ev.Out]
  }

  sealed trait X[Y] extends Any {
    type S = Y
  }

  object X {
    private val _unit: Op[Nothing, Null, HNil] = ???
    private def unit[S, T]: Op[S, T, HNil] = _unit.asInstanceOf[Op[S, T, HNil]]

    def apply[T]: Next[T] = next.asInstanceOf[Next[T]]
    trait Next[T] {
      def apply[U, E <: Effects](body: X[T] => Op[T, U, E]): Op[T, U, E] =
        unit[T, X[T]].flatMap(body)
    }
    private object next extends Next[Nothing]
  }

}

Removing the third type parameter from Op (i.e. not tracking effects) makes the crash go away. This code is copied from code that works in 2.11/2.12.

@rkuhn
Copy link
Author

rkuhn commented Jun 3, 2017

Ah: this works!

  trait Op[S, +T, E <: Effects] {
    def flatMap[U, EE <: Effects, EO <: Effects](f: T => Op[S, U, EE])(
           implicit ev: ops.PrependAux[E, EE, EO]): Op[S, U, EO]
  }

@smarter
Copy link
Member

smarter commented Jun 3, 2017

Thanks a lot! I minimized it further to:

class Foo[T]

trait Prepend {
  type Out
}

object Test {
  def foo()(implicit ev: Prepend): Foo[ev.Out] = ???

  def test: Unit = {
    foo(): Foo[Any]
  }
}

@rkuhn
Copy link
Author

rkuhn commented Jun 4, 2017

I removed all occurrences of path-dependent return types from akka-typed-session and now it successfully compiles.

smarter referenced this issue Jul 19, 2017
Revert: Avoid assertion failure on neg test
odersky added a commit to dotty-staging/dotty that referenced this issue Jul 19, 2017
constrainResult should behave like isSubType in this respect.
This fixes scala#2672. The assertion in Applications.scala is no
longer needed because it is now obviously true by design.
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.

3 participants