Skip to content

post/Iter3.scala fails to compile. ClassCast exception in typer. #840

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
DarkDimius opened this issue Oct 21, 2015 · 7 comments
Closed

post/Iter3.scala fails to compile. ClassCast exception in typer. #840

DarkDimius opened this issue Oct 21, 2015 · 7 comments
Assignees

Comments

@DarkDimius
Copy link
Contributor

after applying #836, #833 and #837.

dotc -bootstrapped Iter3.scala

exception occurred while compiling Iter3.scala
Exception in thread "main" java.lang.ClassCastException: dotty.tools.dotc.core.Types$PolyParam cannot be cast to dotty.tools.dotc.core.Types$TypeBounds
    at dotty.tools.dotc.core.OrderingConstraint.nonParamBounds(OrderingConstraint.scala:193)
    at dotty.tools.dotc.core.OrderingConstraint.narrowBound(OrderingConstraint.scala:356)
    at dotty.tools.dotc.core.OrderingConstraint.narrowBound(OrderingConstraint.scala:126)
    at dotty.tools.dotc.core.ConstraintHandling.addOneBound(ConstraintHandling.scala:38)
    at dotty.tools.dotc.core.ConstraintHandling.$anonfun$unify$3(ConstraintHandling.scala:105)
    at dotty.tools.dotc.core.ConstraintHandling$$Lambda$720/341748265.apply(Unknown Source)
    at scala.collection.LinearSeqOptimized$class.forall(LinearSeqOptimized.scala:83)
    at scala.collection.immutable.List.forall(List.scala:84)
    at dotty.tools.dotc.core.ConstraintHandling.unify(ConstraintHandling.scala:105)
    at dotty.tools.dotc.core.ConstraintHandling.addLess(ConstraintHandling.scala:76)
    at dotty.tools.dotc.core.TypeComparer.addLess(TypeComparer.scala:19)
    at dotty.tools.dotc.core.ConstraintHandling.liftedTree1$1(ConstraintHandling.scala:227)
    at dotty.tools.dotc.core.ConstraintHandling.addConstraint(ConstraintHandling.scala:225)
    at dotty.tools.dotc.core.TypeComparer.addConstraint(TypeComparer.scala:19)
    at dotty.tools.dotc.core.TypeComparer.comparePolyParam$1(TypeComparer.scala:255)
    at dotty.tools.dotc.core.TypeComparer.secondTry(TypeComparer.scala:258)
    at dotty.tools.dotc.core.TypeComparer.firstTry(TypeComparer.scala:177)
    at dotty.tools.dotc.core.TypeComparer.liftedTree3$1(TypeComparer.scala:100)
    at dotty.tools.dotc.core.TypeComparer.$anonfun$isSubType$3(TypeComparer.scala:97)
    at dotty.tools.dotc.core.TypeComparer$$Lambda$372/1458849419.apply$mcZ$sp(Unknown Source)
    at scala.compat.java8.JFunction0$mcZ$sp.apply(JFunction0$mcZ$sp.java:12)
    at dotty.tools.dotc.reporting.Reporting.traceIndented(Reporter.scala:148)
    at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:53)
    at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:91)
    at dotty.tools.dotc.core.TypeComparer.secondTry(TypeComparer.scala:272)
    at dotty.tools.dotc.core.TypeComparer.firstTry(TypeComparer.scala:177)
    at dotty.tools.dotc.core.TypeComparer.liftedTree3$1(TypeComparer.scala:100)
    at dotty.tools.dotc.core.TypeComparer.$anonfun$isSubType$3(TypeComparer.scala:97)
    at dotty.tools.dotc.core.TypeComparer$$Lambda$372/1458849419.apply$mcZ$sp(Unknown Source)
    at scala.compat.java8.JFunction0$mcZ$sp.apply(JFunction0$mcZ$sp.java:12)
    at dotty.tools.dotc.reporting.Reporting.traceIndented(Reporter.scala:148)
    at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:53)
    at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:91)
    at dotty.tools.dotc.core.TypeComparer.firstTry(TypeComparer.scala:179)
    at dotty.tools.dotc.core.TypeComparer.liftedTree3$1(TypeComparer.scala:100)
    at dotty.tools.dotc.core.TypeComparer.$anonfun$isSubType$3(TypeComparer.scala:97)
    at dotty.tools.dotc.core.TypeComparer$$Lambda$372/1458849419.apply$mcZ$sp(Unknown Source)
    at scala.compat.java8.JFunction0$mcZ$sp.apply(JFunction0$mcZ$sp.java:12)
    at dotty.tools.dotc.reporting.Reporting.traceIndented(Reporter.scala:148)
    at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:53)
    at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:91)
    at dotty.tools.dotc.core.TypeComparer.compareTypeBounds$1(TypeComparer.scala:401)
    at dotty.tools.dotc.core.TypeComparer.thirdTry(TypeComparer.scala:408)
    at dotty.tools.dotc.core.TypeComparer.secondTry(TypeComparer.scala:291)
    at dotty.tools.dotc.core.TypeComparer.firstTry(TypeComparer.scala:232)
    at dotty.tools.dotc.core.TypeComparer.liftedTree3$1(TypeComparer.scala:100)
    at dotty.tools.dotc.core.TypeComparer.$anonfun$isSubType$3(TypeComparer.scala:97)
    at dotty.tools.dotc.core.TypeComparer$$Lambda$372/1458849419.apply$mcZ$sp(Unknown Source)
    at scala.compat.java8.JFunction0$mcZ$sp.apply(JFunction0$mcZ$sp.java:12)
    at dotty.tools.dotc.reporting.Reporting.traceIndented(Reporter.scala:148)
    at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:53)
    at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:91)
    at dotty.tools.dotc.core.TypeComparer.isSubRefinements(TypeComparer.scala:616)
    at dotty.tools.dotc.core.TypeComparer.compareRefined$1(TypeComparer.scala:344)
    at dotty.tools.dotc.core.TypeComparer.thirdTry(TypeComparer.scala:346)
    at dotty.tools.dotc.core.TypeComparer.secondTry(TypeComparer.scala:291)
    at dotty.tools.dotc.core.TypeComparer.firstTry(TypeComparer.scala:232)
    at dotty.tools.dotc.core.TypeComparer.liftedTree3$1(TypeComparer.scala:100)
    at dotty.tools.dotc.core.TypeComparer.$anonfun$isSubType$3(TypeComparer.scala:97)
    at dotty.tools.dotc.core.TypeComparer$$Lambda$372/1458849419.apply$mcZ$sp(Unknown Source)
    at scala.compat.java8.JFunction0$mcZ$sp.apply(JFunction0$mcZ$sp.java:12)
    at dotty.tools.dotc.reporting.Reporting.traceIndented(Reporter.scala:148)
    at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:53)
    at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:91)
    at dotty.tools.dotc.core.TypeComparer.topLevelSubType(TypeComparer.scala:85)
    at dotty.tools.dotc.core.Types$Type.$anonfun$$less$colon$less$1(Types.scala:595)
    at dotty.tools.dotc.core.Types$Type$$Lambda$370/600746945.apply$mcZ$sp(Unknown Source)
    at scala.compat.java8.JFunction0$mcZ$sp.apply(JFunction0$mcZ$sp.java:12)
    at dotty.tools.dotc.util.Stats$.track(Stats.scala:31)
    at dotty.tools.dotc.core.Types$Type.$less$colon$less(Types.scala:594)
    at dotty.tools.dotc.typer.ProtoTypes$Compatibility.isCompatible(ProtoTypes.scala:37)
    at dotty.tools.dotc.typer.Typer.isCompatible(Typer.scala:57)
    at dotty.tools.dotc.typer.ProtoTypes$Compatibility.constrainResult(ProtoTypes.scala:61)
    at dotty.tools.dotc.typer.Typer.constrainResult(Typer.scala:57)
    at dotty.tools.dotc.typer.Applications$Application.init(Applications.scala:183)
    at dotty.tools.dotc.typer.Applications$TypedApply.<init>(Applications.scala:434)
    at dotty.tools.dotc.typer.Applications$ApplyToUntyped.<init>(Applications.scala:512)
    at dotty.tools.dotc.typer.Applications.$anonfun$$anonfun$realApply$1$2(Applications.scala:549)
    at dotty.tools.dotc.typer.Applications$$Lambda$421/94345706.apply(Unknown Source)
    at dotty.tools.dotc.typer.Typer.tryEither(Typer.scala:1215)
    at dotty.tools.dotc.typer.Applications.$anonfun$realApply$1(Applications.scala:559)
    at dotty.tools.dotc.typer.Applications$$Lambda$419/644166178.apply(Unknown Source)
    at dotty.tools.dotc.util.Stats$.track(Stats.scala:31)
    at dotty.tools.dotc.typer.Applications.realApply$1(Applications.scala:530)
    at dotty.tools.dotc.typer.Applications.typedApply(Applications.scala:596)
    at dotty.tools.dotc.typer.Typer.typedApply(Typer.scala:57)
    at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1120)
    at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1160)
    at dotty.tools.dotc.typer.ProtoTypes$FunProto.typedArg(ProtoTypes.scala:201)
    at dotty.tools.dotc.typer.Applications$ApplyToUntyped.typedArg(Applications.scala:513)
    at dotty.tools.dotc.typer.Applications$ApplyToUntyped.typedArg(Applications.scala:511)
    at dotty.tools.dotc.typer.Applications$Application.addTyped$1(Applications.scala:316)
    at dotty.tools.dotc.typer.Applications$Application.matchArgs(Applications.scala:355)
    at dotty.tools.dotc.typer.Applications$Application.matchArgs(Applications.scala:356)
    at dotty.tools.dotc.typer.Applications$Application.init(Applications.scala:192)
    at dotty.tools.dotc.typer.Applications$TypedApply.<init>(Applications.scala:434)
    at dotty.tools.dotc.typer.Applications$ApplyToUntyped.<init>(Applications.scala:512)
    at dotty.tools.dotc.typer.Applications.$anonfun$$anonfun$realApply$1$2(Applications.scala:549)
    at dotty.tools.dotc.typer.Applications$$Lambda$421/94345706.apply(Unknown Source)
    at dotty.tools.dotc.typer.Typer.tryEither(Typer.scala:1215)
    at dotty.tools.dotc.typer.Applications.$anonfun$realApply$1(Applications.scala:559)
    at dotty.tools.dotc.typer.Applications$$Lambda$419/644166178.apply(Unknown Source)
    at dotty.tools.dotc.util.Stats$.track(Stats.scala:31)
    at dotty.tools.dotc.typer.Applications.realApply$1(Applications.scala:530)
    at dotty.tools.dotc.typer.Applications.typedApply(Applications.scala:596)
    at dotty.tools.dotc.typer.Typer.typedApply(Typer.scala:57)
    at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1120)
    at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1160)
    at dotty.tools.dotc.typer.Typer.liftedTree12$1(Typer.scala:1170)
    at dotty.tools.dotc.typer.Typer.$anonfun$typed$2(Typer.scala:1170)
    at dotty.tools.dotc.typer.Typer$$Lambda$275/288665596.apply(Unknown Source)
    at dotty.tools.dotc.reporting.Reporting.traceIndented(Reporter.scala:148)
    at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:53)
    at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1168)
    at dotty.tools.dotc.typer.Typer.$anonfun$typedIf$1(Typer.scala:494)
    at dotty.tools.dotc.typer.Typer$$Lambda$473/1164371389.apply(Unknown Source)
    at dotty.tools.dotc.util.Stats$.track(Stats.scala:31)
    at dotty.tools.dotc.typer.Typer.typedIf(Typer.scala:492)
    at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1129)
    at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1160)
    at dotty.tools.dotc.typer.Typer.liftedTree12$1(Typer.scala:1170)
    at dotty.tools.dotc.typer.Typer.$anonfun$typed$2(Typer.scala:1170)
    at dotty.tools.dotc.typer.Typer$$Lambda$275/288665596.apply(Unknown Source)
    at dotty.tools.dotc.reporting.Reporting.traceIndented(Reporter.scala:148)
    at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:53)
    at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1168)
    at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:1207)
    at dotty.tools.dotc.typer.Typer.$anonfun$typedBlock$2(Typer.scala:447)
    at dotty.tools.dotc.typer.Typer$$Lambda$468/1926764753.apply(Unknown Source)
    at dotty.tools.dotc.util.Stats$.track(Stats.scala:31)
    at dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:444)
    at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1128)
    at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1160)
    at dotty.tools.dotc.typer.Typer.liftedTree12$1(Typer.scala:1170)
    at dotty.tools.dotc.typer.Typer.$anonfun$typed$2(Typer.scala:1170)
    at dotty.tools.dotc.typer.Typer$$Lambda$275/288665596.apply(Unknown Source)
    at dotty.tools.dotc.reporting.Reporting.traceIndented(Reporter.scala:148)
    at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:53)
    at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1168)
    at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:1207)
    at dotty.tools.dotc.typer.Typer.caseRest$1(Typer.scala:678)
    at dotty.tools.dotc.typer.Typer.$anonfun$typedCase$3(Typer.scala:693)
    at dotty.tools.dotc.typer.Typer$$Lambda$642/90205195.apply(Unknown Source)
    at dotty.tools.dotc.util.Stats$.track(Stats.scala:31)
    at dotty.tools.dotc.typer.Typer.typedCase(Typer.scala:667)
    at dotty.tools.dotc.typer.Typer.$anonfun$typedCases$1(Typer.scala:661)
    at dotty.tools.dotc.typer.Typer$$Lambda$641/564742142.apply(Unknown Source)
    at dotty.tools.dotc.core.Decorators$ListDecorator$.loop$4(Decorators.scala:51)
    at dotty.tools.dotc.core.Decorators$ListDecorator$.mapconserve$extension(Decorators.scala:67)
    at dotty.tools.dotc.typer.Typer.typedCases(Typer.scala:661)
    at dotty.tools.dotc.typer.Typer.$anonfun$typedMatch$1(Typer.scala:633)
    at dotty.tools.dotc.typer.Typer$$Lambda$638/326298949.apply(Unknown Source)
    at dotty.tools.dotc.util.Stats$.track(Stats.scala:31)
    at dotty.tools.dotc.typer.Typer.typedMatch(Typer.scala:624)
    at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1132)
    at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1160)
    at dotty.tools.dotc.typer.Typer.liftedTree12$1(Typer.scala:1170)
    at dotty.tools.dotc.typer.Typer.$anonfun$typed$2(Typer.scala:1170)
    at dotty.tools.dotc.typer.Typer$$Lambda$275/288665596.apply(Unknown Source)
    at dotty.tools.dotc.reporting.Reporting.traceIndented(Reporter.scala:148)
    at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:53)
    at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1168)
    at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:1207)
    at dotty.tools.dotc.typer.Typer.$anonfun$typedDefDef$2(Typer.scala:934)
    at dotty.tools.dotc.typer.Typer$$Lambda$429/1580893732.apply(Unknown Source)
    at dotty.tools.dotc.util.Stats$.track(Stats.scala:31)
    at dotty.tools.dotc.typer.Typer.typedDefDef(Typer.scala:927)
    at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:1108)
    at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1158)
    at dotty.tools.dotc.typer.Typer.liftedTree12$1(Typer.scala:1170)
    at dotty.tools.dotc.typer.Typer.$anonfun$typed$2(Typer.scala:1170)
    at dotty.tools.dotc.typer.Typer$$Lambda$275/288665596.apply(Unknown Source)
    at dotty.tools.dotc.reporting.Reporting.traceIndented(Reporter.scala:148)
    at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:53)
    at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1168)
    at dotty.tools.dotc.typer.Typer.traverse$2(Typer.scala:1192)
    at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:1203)
    at dotty.tools.dotc.typer.Typer.$anonfun$typedClassDef$3(Typer.scala:963)
    at dotty.tools.dotc.typer.Typer$$Lambda$425/32017212.apply(Unknown Source)
    at dotty.tools.dotc.util.Stats$.track(Stats.scala:31)
    at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:946)
    at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:1111)
    at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1158)
    at dotty.tools.dotc.typer.Typer.liftedTree12$1(Typer.scala:1170)
    at dotty.tools.dotc.typer.Typer.$anonfun$typed$2(Typer.scala:1170)
    at dotty.tools.dotc.typer.Typer$$Lambda$275/288665596.apply(Unknown Source)
    at dotty.tools.dotc.reporting.Reporting.traceIndented(Reporter.scala:148)
    at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:53)
    at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1168)
    at dotty.tools.dotc.typer.Typer.traverse$2(Typer.scala:1192)
    at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:1203)
    at dotty.tools.dotc.typer.Typer.$anonfun$typedClassDef$3(Typer.scala:963)
    at dotty.tools.dotc.typer.Typer$$Lambda$425/32017212.apply(Unknown Source)
    at dotty.tools.dotc.util.Stats$.track(Stats.scala:31)
    at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:946)
    at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:1111)
    at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1158)
    at dotty.tools.dotc.typer.Typer.liftedTree12$1(Typer.scala:1170)
    at dotty.tools.dotc.typer.Typer.$anonfun$typed$2(Typer.scala:1170)
    at dotty.tools.dotc.typer.Typer$$Lambda$275/288665596.apply(Unknown Source)
    at dotty.tools.dotc.reporting.Reporting.traceIndented(Reporter.scala:148)
    at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:53)
    at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1168)
    at dotty.tools.dotc.typer.Typer.traverse$2(Typer.scala:1192)
    at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:1203)
    at dotty.tools.dotc.typer.Typer.$anonfun$typedPackageDef$1(Typer.scala:1051)
    at dotty.tools.dotc.typer.Typer$$Lambda$277/796684896.apply(Unknown Source)
    at dotty.tools.dotc.util.Stats$.track(Stats.scala:31)
    at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:1042)
    at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1148)
    at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1160)
    at dotty.tools.dotc.typer.Typer.liftedTree12$1(Typer.scala:1170)
    at dotty.tools.dotc.typer.Typer.$anonfun$typed$2(Typer.scala:1170)
    at dotty.tools.dotc.typer.Typer$$Lambda$275/288665596.apply(Unknown Source)
    at dotty.tools.dotc.reporting.Reporting.traceIndented(Reporter.scala:148)
    at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:53)
    at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1168)
    at dotty.tools.dotc.typer.Typer.traverse$2(Typer.scala:1198)
    at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:1203)
    at dotty.tools.dotc.typer.Typer.$anonfun$typedPackageDef$1(Typer.scala:1051)
    at dotty.tools.dotc.typer.Typer$$Lambda$277/796684896.apply(Unknown Source)
    at dotty.tools.dotc.util.Stats$.track(Stats.scala:31)
    at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:1042)
    at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1148)
    at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1160)
    at dotty.tools.dotc.typer.Typer.liftedTree12$1(Typer.scala:1170)
    at dotty.tools.dotc.typer.Typer.$anonfun$typed$2(Typer.scala:1170)
    at dotty.tools.dotc.typer.Typer$$Lambda$275/288665596.apply(Unknown Source)
    at dotty.tools.dotc.reporting.Reporting.traceIndented(Reporter.scala:148)
    at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:53)
    at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1168)
    at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:1207)
    at dotty.tools.dotc.typer.FrontEnd.$anonfun$typeCheck$1(FrontEnd.scala:42)
    at dotty.tools.dotc.typer.FrontEnd$$Lambda$273/1513712028.apply$mcV$sp(Unknown Source)
    at scala.compat.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
    at dotty.tools.dotc.typer.FrontEnd.monitor(FrontEnd.scala:19)
    at dotty.tools.dotc.typer.FrontEnd.typeCheck(FrontEnd.scala:46)
    at dotty.tools.dotc.typer.FrontEnd.$anonfun$runOn$7(FrontEnd.scala:53)
    at dotty.tools.dotc.typer.FrontEnd$$Lambda$272/747464370.applyVoid(Unknown Source)
    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:381)
    at dotty.tools.dotc.typer.FrontEnd.runOn(FrontEnd.scala:53)
    at dotty.tools.dotc.Run.$anonfun$$anonfun$3(Run.scala:59)
    at dotty.tools.dotc.Run$$Lambda$194/611437735.applyVoid(Unknown Source)
    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.$anonfun$compileUnits$1(Run.scala:57)
    at dotty.tools.dotc.Run$$Lambda$185/1761291320.apply$mcV$sp(Unknown Source)
    at scala.compat.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
    at dotty.tools.dotc.util.Stats$.monitorHeartBeat(Stats.scala:58)
    at dotty.tools.dotc.Run.compileUnits(Run.scala:65)
    at dotty.tools.dotc.Run.compileSources(Run.scala:49)
    at dotty.tools.dotc.Run.compile(Run.scala:33)
    at dotty.tools.dotc.Driver.doCompile(Driver.scala:21)
    at dotty.tools.dotc.Driver.process(Driver.scala:44)
    at dotty.tools.dotc.Driver.main(Driver.scala:48)
    at dotty.tools.dotc.Main.main(Main.scala)
@DarkDimius DarkDimius changed the title post/Iter3.scala fails to compile after bootstrap post/Iter3.scala fails to compile after bootstrap. ClassCast exeptionn in typer. Oct 21, 2015
@DarkDimius DarkDimius changed the title post/Iter3.scala fails to compile after bootstrap. ClassCast exeptionn in typer. post/Iter3.scala fails to compile after bootstrap. ClassCast exception in typer. Oct 21, 2015
@DarkDimius
Copy link
Contributor Author

Same error seems to happen in t2504.scala

@DarkDimius
Copy link
Contributor Author

Same error seems to happen in t2293.scala
And typers.scala, and t8230a.scala

@DarkDimius
Copy link
Contributor Author

dotc -bootstrapped Iter3.scala
Leads to the same error on my machine.
This is not specific to bootstrapped version.

@DarkDimius DarkDimius changed the title post/Iter3.scala fails to compile after bootstrap. ClassCast exception in typer. post/Iter3.scala fails to compile. ClassCast exception in typer. Oct 22, 2015
@DarkDimius
Copy link
Contributor Author

https://www.diffchecker.com/trmxnro9 contains diff between typecheckings

@smarter smarter self-assigned this Oct 22, 2015
@DarkDimius
Copy link
Contributor Author

Ok. I have progress here.

OrderingConstraint.scala:

def contains(param: PolyParam): Boolean = {
    val entries = boundsMap(param.binder)
    entries != null && entries(param.paramNum).isInstanceOf[TypeBounds]
  }

becomes

def contains(param: dotty.tools.dotc.core.Types.Types$PolyParam):
          Boolean
         = {
          val entries: dotty.tools.dotc.core.Types.Types$Type[] =
            OrderingConstraint.this.boundsMap().apply(param.binder()).
              asInstanceOf
            [dotty.tools.dotc.core.Types.Types$Type[]]
          entries.==(null).unary_!().&&(true)
        }

after erasure.

I've traced it to this line:
https://github.com/lampepfl/dotty/blob/master/src/dotty/tools/dotc/transform/TypeTestsCasts.scala#L50

where for expr = entries.apply(param.paramNum) we have type TypeRef(TermRef(NoPrefix,entries),scala$Array$$T) that is an alias to TypeAlias(WildcardType(NoType)).

@DarkDimius
Copy link
Contributor Author

how to reproduce:

dotc ./dotty/tools/dotc/core/OrderingConstraint.scala -Xprint:eras

....
result of ./dotty/tools/dotc/core/OrderingConstraint.scala after erasure:
package dotty.tools {
  package dotty.tools.dotc {
    package dotty.tools.dotc.core {
      final lazy module val OrderingConstraint:
        dotty.tools.dotc.core.OrderingConstraint$
       = new dotty.tools.dotc.core.OrderingConstraint$()
      class OrderingConstraint(boundsMap: dotty.tools.dotc.util.SimpleMap,
        lowerMap: dotty.tools.dotc.util.SimpleMap
      , upperMap: dotty.tools.dotc.util.SimpleMap) extends
        dotty.tools.dotc.core.Constraint
      () {
        private <accessor> def boundsMap(): dotty.tools.dotc.util.SimpleMap
        private <accessor> def lowerMap(): dotty.tools.dotc.util.SimpleMap
        private <accessor> def upperMap(): dotty.tools.dotc.util.SimpleMap
        private def paramCount(entries: dotty.tools.dotc.core.Types.Type[]): Int
           =
        entries.[]length().>>(1)
        private def typeVar(entries: dotty.tools.dotc.core.Types.Type[], n: Int)
          :
        dotty.tools.dotc.core.Types.Type =
          entries.[]apply(this.paramCount(entries).+(n))
        def entry(param: dotty.tools.dotc.core.Types.PolyParam):
          dotty.tools.dotc.core.Types.Type
         = {
          val entries: dotty.tools.dotc.core.Types.Type[] =
            OrderingConstraint.this.boundsMap().apply(param.binder()).
              asInstanceOf
            [dotty.tools.dotc.core.Types.Type[]]
          if entries.==(null) then dotty.tools.dotc.core.Types.NoType else
            entries.[]apply(param.paramNum())
        }
        def contains(pt: dotty.tools.dotc.core.Types.PolyType): Boolean =
          OrderingConstraint.this.boundsMap().apply(pt).==(null).unary_!()
        def contains(param: dotty.tools.dotc.core.Types.PolyParam): Boolean = {
          val entries: dotty.tools.dotc.core.Types.Type[] =
            OrderingConstraint.this.boundsMap().apply(param.binder()).
              asInstanceOf
            [dotty.tools.dotc.core.Types.Type[]]
          entries.==(null).unary_!().&&(true)
        }

see true in the last line.

@DarkDimius DarkDimius assigned odersky and unassigned smarter Oct 22, 2015
DarkDimius added a commit to dotty-staging/dotty that referenced this issue Oct 22, 2015
@DarkDimius
Copy link
Contributor Author

Not a blocker anymore, as I have a workaroud

DarkDimius added a commit to dotty-staging/dotty that referenced this issue Oct 23, 2015
DarkDimius added a commit to dotty-staging/dotty that referenced this issue Oct 23, 2015
This reverts commit acd7b9d.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants