-
Notifications
You must be signed in to change notification settings - Fork 1.1k
extension methods crash dotty when compiled with 2.13.4 snapshot #9358
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
second piece of evidence (eta expansion): package example
import MyPredef._
object Main extends App {
println(ArrowAssoc2.<&>)
} crashes because the companion of ArrowAssoc2 is NoType: exception occurred while typechecking Main.scala
exception occurred while compiling Main.scala
scala.MatchError: NoType (of class dotty.tools.dotc.core.Types$NoType$) while compiling Main.scala
Exception in thread "main" scala.MatchError: NoType (of class dotty.tools.dotc.core.Types$NoType$)
at dotty.tools.dotc.core.SymDenotations$SymDenotation.sourceOfSelf$1(SymDenotations.scala:1011)
at dotty.tools.dotc.core.SymDenotations$SymDenotation.sourceModule(SymDenotations.scala:1013)
at dotty.tools.dotc.core.SymDenotations$SymDenotation.companionModule(SymDenotations.scala:1148)
at dotty.tools.dotc.core.TypeComparer.compareNamed$1(TypeComparer.scala:257)
at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:275)
at dotty.tools.dotc.core.TypeComparer.op$1(TypeComparer.scala:1088)
at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1107)
at dotty.tools.dotc.core.TypeComparer.compareTypeParamRef$2(TypeComparer.scala:517)
at dotty.tools.dotc.core.TypeComparer.thirdTry$1(TypeComparer.scala:529)
at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:362)
at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:279)
at dotty.tools.dotc.core.TypeComparer.op$1(TypeComparer.scala:1088)
at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1107)
at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:164)
at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:174)
at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:174)
at dotty.tools.dotc.core.ConstraintHandling.op$1(ConstraintHandling.scala:221)
at dotty.tools.dotc.core.ConstraintHandling.isSubTypeWhenFrozen(ConstraintHandling.scala:221)
at dotty.tools.dotc.core.TypeComparer.isSubTypeWhenFrozen(TypeComparer.scala:31)
at dotty.tools.dotc.core.TypeComparer.compareTypeParamRef$2(TypeComparer.scala:518)
at dotty.tools.dotc.core.TypeComparer.thirdTry$1(TypeComparer.scala:529)
at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:362)
at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:279)
at dotty.tools.dotc.core.TypeComparer.op$1(TypeComparer.scala:1088)
at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1107)
at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:164)
at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:174)
at dotty.tools.dotc.core.TypeComparer.topLevelSubType(TypeComparer.scala:131)
at dotty.tools.dotc.core.Types$Type.$less$colon$less(Types.scala:903)
at dotty.tools.dotc.core.ConstraintHandling.widenSingle$1(ConstraintHandling.scala:316)
at dotty.tools.dotc.core.ConstraintHandling.widenInferred(ConstraintHandling.scala:320)
at dotty.tools.dotc.core.TypeComparer.widenInferred(TypeComparer.scala:31)
at dotty.tools.dotc.core.ConstraintHandling.instanceType(ConstraintHandling.scala:336)
at dotty.tools.dotc.core.TypeComparer.instanceType(TypeComparer.scala:31)
at dotty.tools.dotc.core.Types$TypeVar.instantiate(Types.scala:4165)
at dotty.tools.dotc.typer.Inferencing$IsFullyDefinedAccumulator.instantiate(Inferencing.scala:114)
at dotty.tools.dotc.typer.Inferencing$IsFullyDefinedAccumulator.apply(Inferencing.scala:130)
at dotty.tools.dotc.typer.Inferencing$IsFullyDefinedAccumulator.apply(Inferencing.scala:121)
at dotty.tools.dotc.core.Types$TypeAccumulator.op$4(Types.scala:5301)
at dotty.tools.dotc.core.Types$TypeAccumulator.foldArgs$1(Types.scala:5301)
at dotty.tools.dotc.core.Types$TypeAccumulator.foldOver(Types.scala:5305)
at dotty.tools.dotc.typer.Inferencing$IsFullyDefinedAccumulator.apply(Inferencing.scala:144)
at dotty.tools.dotc.typer.Inferencing$IsFullyDefinedAccumulator.process(Inferencing.scala:155)
at dotty.tools.dotc.typer.Inferencing$.isFullyDefined(Inferencing.scala:34)
at dotty.tools.dotc.typer.Inferencing$.fullyDefinedType(Inferencing.scala:43)
at dotty.tools.dotc.typer.Namer.lhsType$1(Namer.scala:1468)
at dotty.tools.dotc.typer.Namer.inferredType$1(Namer.scala:1479)
at dotty.tools.dotc.typer.Namer.valOrDefDefSig(Namer.scala:1487)
at dotty.tools.dotc.typer.Namer.defDefSig(Namer.scala:1559)
at dotty.tools.dotc.typer.Namer$Completer.typeSig(Namer.scala:812)
at dotty.tools.dotc.typer.Namer$Completer.completeInCreationContext(Namer.scala:929)
at dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:840)
at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:260)
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.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:400)
at dotty.tools.dotc.typer.Typer.retrieveSym(Typer.scala:2160)
at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2185)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2265)
at dotty.tools.dotc.typer.Typer.op$1(Typer.scala:2304)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2313)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2316)
at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2338)
at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2382)
at dotty.tools.dotc.typer.Typer.typedBlockStats(Typer.scala:821)
at dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:825)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2216)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2266)
at dotty.tools.dotc.typer.Typer.op$1(Typer.scala:2304)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2313)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2316)
at dotty.tools.dotc.typer.Typer.typedFunctionValue(Typer.scala:1132)
at dotty.tools.dotc.typer.Typer.typedFunction(Typer.scala:939)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2218)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2266)
at dotty.tools.dotc.typer.Typer.op$1(Typer.scala:2304)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2313)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2316)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2424)
at dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:826)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2216)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2266)
at dotty.tools.dotc.typer.Typer.op$1(Typer.scala:2304)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2313)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2316)
at dotty.tools.dotc.typer.Typer.adaptNoArgsUnappliedMethod$2(Typer.scala:2900)
at dotty.tools.dotc.typer.Typer.adaptNoArgs$1(Typer.scala:3034)
at dotty.tools.dotc.typer.Typer.adapt1(Typer.scala:3244)
at dotty.tools.dotc.typer.Typer.op$3(Typer.scala:2635)
at dotty.tools.dotc.typer.Typer.adapt(Typer.scala:2636)
at dotty.tools.dotc.typer.Typer.readapt$1(Typer.scala:2645)
at dotty.tools.dotc.typer.Typer.adapt1(Typer.scala:3228)
at dotty.tools.dotc.typer.Typer.op$3(Typer.scala:2635)
at dotty.tools.dotc.typer.Typer.adapt(Typer.scala:2636)
at dotty.tools.dotc.typer.Typer.op$1(Typer.scala:2304)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2313)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2316)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2424)
at dotty.tools.dotc.typer.Typer.typeSelectOnTerm$1(Typer.scala:508)
at dotty.tools.dotc.typer.Typer.typedSelect(Typer.scala:532)
at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2188)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2265)
at dotty.tools.dotc.typer.Typer.op$1(Typer.scala:2304)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2313)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2316)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2424)
at dotty.tools.dotc.typer.Applications.typedFunPart$$anonfun$1(Applications.scala:820)
at dotty.tools.dotc.typer.Typer.tryEither(Typer.scala:2432)
at dotty.tools.dotc.typer.Applications.typedFunPart(Applications.scala:828)
at dotty.tools.dotc.typer.Typer.typedFunPart(Typer.scala:83)
at dotty.tools.dotc.typer.Applications.realApply$1(Applications.scala:839)
at dotty.tools.dotc.typer.Applications.typedApply(Applications.scala:976)
at dotty.tools.dotc.typer.Typer.typedApply(Typer.scala:83)
at dotty.tools.dotc.typer.Typer.typedInfixOp(Typer.scala:2107)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2245)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2266)
at dotty.tools.dotc.typer.ProtoTypes$FunProto.$anonfun$2(ProtoTypes.scala:340)
at dotty.tools.dotc.typer.ProtoTypes$FunProto.cacheTypedArg(ProtoTypes.scala:296)
at dotty.tools.dotc.typer.ProtoTypes$FunProto.typedArg(ProtoTypes.scala:341)
at dotty.tools.dotc.typer.Applications$ApplyToUntyped.typedArg(Applications.scala:795)
at dotty.tools.dotc.typer.Applications$ApplyToUntyped.typedArg(Applications.scala:795)
at dotty.tools.dotc.typer.Applications$Application.addTyped$1(Applications.scala:530)
at dotty.tools.dotc.typer.Applications$Application.matchArgs(Applications.scala:599)
at dotty.tools.dotc.typer.Applications$Application.init(Applications.scala:355)
at dotty.tools.dotc.typer.Applications$TypedApply.<init>(Applications.scala:692)
at dotty.tools.dotc.typer.Applications$ApplyToUntyped.<init>(Applications.scala:794)
at dotty.tools.dotc.typer.Applications.simpleApply$1(Applications.scala:868)
at dotty.tools.dotc.typer.Applications.realApply$7$$anonfun$6(Applications.scala:929)
at dotty.tools.dotc.typer.Typer.tryEither(Typer.scala:2432)
at dotty.tools.dotc.typer.Applications.realApply$1(Applications.scala:940)
at dotty.tools.dotc.typer.Applications.typedApply(Applications.scala:976)
at dotty.tools.dotc.typer.Typer.typedApply(Typer.scala:83)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2208)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2266)
at dotty.tools.dotc.typer.Typer.op$1(Typer.scala:2304)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2313)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2316)
at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2360)
at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2382)
at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:1875)
at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2198)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2265)
at dotty.tools.dotc.typer.Typer.op$1(Typer.scala:2304)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2313)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2316)
at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2338)
at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2382)
at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:2001)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2239)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2266)
at dotty.tools.dotc.typer.Typer.op$1(Typer.scala:2304)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2313)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2316)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2424)
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:167)
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:177)
at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:185)
at dotty.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:64)
at dotty.tools.dotc.Run.compileUnits(Run.scala:192)
at dotty.tools.dotc.Run.compileSources(Run.scala:129)
at dotty.tools.dotc.Run.compile(Run.scala:112)
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)
instead of compiling |
With 2.13.4 coming this month this is more critical |
it still crashes with Scala
|
should be fixed by #10006 |
Yes I tested that PR with Scala |
#10006 is merged, closing. |
Minimized code
before scala/scala@6acc8ff (2.13.4 snapshot) implicit conversions for AnyVal classes came after the companion object in pickles.
As of that commit, they can come before the companion object, this causes a crash in dotty
compile with scalac on scala/scala@6acc8ff
compile with dotty 0.25.0-RC1:
Output (click arrow to expand)
comparison of pickles
commit scala/scala@f8a7132 (parent)
pickles
commit scala/scala@6acc8ff
pickles
The text was updated successfully, but these errors were encountered: