Skip to content

AssertionError in ConstraintHandling.addToConstraint #4721

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
panacekcz opened this issue Jun 26, 2018 · 1 comment
Closed

AssertionError in ConstraintHandling.addToConstraint #4721

panacekcz opened this issue Jun 26, 2018 · 1 comment

Comments

@panacekcz
Copy link
Contributor

Stack trace is similar to e293c442ee95a3e332eadee8f1db16ef8164a3e7.scala in #4389, code is similar to that used in #4720

ae.scala:

object Test {
  def main(args: Array[String]):Unit = m(1)
  def m[Y<:String, Z>:Int, W>:Z<:Y](d:Y):Unit={}
}

dotc ae.scala:

exception occurred while typechecking ae.scala
exception occurred while compiling ae.scala
Exception in thread "main" java.lang.AssertionError: assertion failed
        at scala.Predef$.assert(Predef.scala:204)
        at dotty.tools.dotc.core.ConstraintHandling.addToConstraint(ConstraintHandling.scala:348)
        at dotty.tools.dotc.core.ConstraintHandling.addToConstraint$(ConstraintHandling.scala:344)
        at dotty.tools.dotc.core.TypeComparer.addToConstraint(TypeComparer.scala:19)
        at dotty.tools.dotc.typer.ProtoTypes$.constrained(ProtoTypes.scala:459)
        at dotty.tools.dotc.typer.Typer.adapt1(Typer.scala:2534)
        at dotty.tools.dotc.typer.Typer.$anonfun$adapt$1(Typer.scala:2091)
        at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
        at dotty.tools.dotc.typer.Typer.adapt(Typer.scala:2086)
        at dotty.tools.dotc.typer.Typer.$anonfun$typed$2(Typer.scala:1873)
        at dotty.tools.dotc.reporting.trace$.apply(trace.scala:40)
        at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1869)
        at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1885)
        at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:1944)
        at dotty.tools.dotc.typer.Applications.$anonfun$typedApply$1(Applications.scala:694)
        at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
        at dotty.tools.dotc.typer.Applications.realApply$1(Applications.scala:692)
        at dotty.tools.dotc.typer.Applications.typedApply(Applications.scala:792)
        at dotty.tools.dotc.typer.Applications.typedApply$(Applications.scala:690)
        at dotty.tools.dotc.typer.Typer.typedApply(Typer.scala:82)
        at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1791)
        at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1842)
        at dotty.tools.dotc.typer.Typer.$anonfun$typed$2(Typer.scala:1873)
        at dotty.tools.dotc.reporting.trace$.apply(trace.scala:40)
        at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1869)
        at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1885)
        at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:1944)
        at dotty.tools.dotc.typer.Typer.$anonfun$typedDefDef$1(Typer.scala:1431)
        at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
        at dotty.tools.dotc.typer.Typer.typedDefDef(Typer.scala:1410)
        at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:1779)
        at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1841)
        at dotty.tools.dotc.typer.Typer.$anonfun$typed$2(Typer.scala:1873)
        at dotty.tools.dotc.reporting.trace$.apply(trace.scala:40)
        at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1869)
        at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1885)
        at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:1904)
        at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:1933)
        at dotty.tools.dotc.typer.Typer.$anonfun$typedClassDef$1(Typer.scala:1536)
        at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
        at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:1458)
        at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:1782)
        at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1841)
        at dotty.tools.dotc.typer.Typer.$anonfun$typed$2(Typer.scala:1873)
        at dotty.tools.dotc.reporting.trace$.apply(trace.scala:40)
        at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1869)
        at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1885)
        at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:1904)
        at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:1933)
        at dotty.tools.dotc.typer.Typer.$anonfun$typedPackageDef$1(Typer.scala:1648)
        at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
        at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:1641)
        at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1821)
        at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1842)
        at dotty.tools.dotc.typer.Typer.$anonfun$typed$2(Typer.scala:1873)
        at dotty.tools.dotc.reporting.trace$.apply(trace.scala:40)
        at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1869)
        at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1885)
        at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:1944)
        at dotty.tools.dotc.typer.FrontEnd.$anonfun$typeCheck$1(FrontEnd.scala:66)
        at dotty.tools.dotc.typer.FrontEnd.monitor(FrontEnd.scala:34)
        at dotty.tools.dotc.typer.FrontEnd.typeCheck(FrontEnd.scala:64)
        at dotty.tools.dotc.typer.FrontEnd.$anonfun$runOn$7(FrontEnd.scala:95)
        at dotty.tools.dotc.typer.FrontEnd.$anonfun$runOn$7$adapted(FrontEnd.scala:95)
        at scala.collection.immutable.List.foreach(List.scala:389)
        at dotty.tools.dotc.typer.FrontEnd.runOn(FrontEnd.scala:95)
        at dotty.tools.dotc.Run.$anonfun$compileUnits$3(Run.scala:174)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
        at dotty.tools.dotc.util.Stats$.trackTime(Stats.scala:47)
        at dotty.tools.dotc.Run.$anonfun$compileUnits$2(Run.scala:171)
        at dotty.tools.dotc.Run.$anonfun$compileUnits$2$adapted(Run.scala:169)
        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:194)
        at dotty.tools.dotc.Run.runPhases$1(Run.scala:169)
        at dotty.tools.dotc.Run.$anonfun$compileUnits$1(Run.scala:194)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
        at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:88)
        at dotty.tools.dotc.Run.compileUnits(Run.scala:149)
        at dotty.tools.dotc.Run.compileSources(Run.scala:136)
        at dotty.tools.dotc.Run.compile(Run.scala:120)
        at dotty.tools.dotc.Driver.doCompile(Driver.scala:29)
        at dotty.tools.dotc.Driver.process(Driver.scala:127)
        at dotty.tools.dotc.Driver.process(Driver.scala:96)
        at dotty.tools.dotc.Driver.process(Driver.scala:108)
        at dotty.tools.dotc.Driver.main(Driver.scala:135)
        at dotty.tools.dotc.Main.main(Main.scala)
@Blaisorblade
Copy link
Contributor

FWIW, this bug wasn't introduced by eeb5965, it's still there in its parent.

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

No branches or pull requests

2 participants