Closed
Description
Compiler version
3.0.0
Minimized code
trait FooBase {
type This <: FooBase { type This <: FooBase.this.This } & FooBase { type This <: FooBase.this.This }
}
(changed from pos test i2941)
Output (Click to expand)
[info] running (fork) dotty.tools.dotc.Main -classpath /Users/linyxus/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.5/scala-library-2.13.5.jar:/Users/linyxus/dev/dotty/library/../out/bootstrap/scala3-library-bootstrapped/scala-3.0.0-RC2/scala3-library_3.0.0-RC2-3.0.0-RC2-bin-SNAPSHOT.jar -color:never -Yno-deep-subtypes investigate/LazyRef.scala
assertion failure for type bounds [[cannot display due to assertion failed, raw string = TypeBounds(OrType(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing),TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing)),AndType(AndType(RefinedType(TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),trait FooBase),This,TypeBounds(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing),LazyRef(null))),RefinedType(TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),trait FooBase),This,TypeBounds(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing),LazyRef(null)))),TypeRef(ThisType(TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),trait FooBase)),type This)))]] <:< type bounds [[cannot display due to assertion failed, raw string = TypeBounds(OrType(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing),TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing)),AndType(AndType(RefinedType(TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),trait FooBase),This,TypeBounds(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing),LazyRef(null))),RefinedType(TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),trait FooBase),This,TypeBounds(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing),LazyRef(null)))),TypeRef(ThisType(TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),trait FooBase)),type This)))]], frozen = true
assertion failure for LazyRef(...) <:< LazyRef(...), frozen = true
assertion failure for type bounds [[cannot display due to assertion failed, raw string = TypeBounds(OrType(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing),TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing)),AndType(AndType(RefinedType(TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),trait FooBase),This,TypeBounds(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing),LazyRef(null))),RefinedType(TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),trait FooBase),This,TypeBounds(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing),LazyRef(null)))),TypeRef(ThisType(TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),trait FooBase)),type This)))]] <:< type bounds [[cannot display due to assertion failed, raw string = TypeBounds(OrType(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing),TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing)),AndType(AndType(RefinedType(TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),trait FooBase),This,TypeBounds(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing),LazyRef(null))),RefinedType(TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),trait FooBase),This,TypeBounds(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing),LazyRef(null)))),TypeRef(ThisType(TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),trait FooBase)),type This)))]], frozen = true
assertion failure for LazyRef(...) <:< LazyRef(...), frozen = true
assertion failure for type bounds [[cannot display due to assertion failed, raw string = TypeBounds(OrType(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing),TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing)),AndType(AndType(RefinedType(TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),trait FooBase),This,TypeBounds(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing),LazyRef(null))),RefinedType(TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),trait FooBase),This,TypeBounds(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing),LazyRef(null)))),TypeRef(ThisType(TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),trait FooBase)),type This)))]] <:< type bounds [[cannot display due to assertion failed, raw string = TypeBounds(OrType(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing),TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing)),AndType(AndType(RefinedType(TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),trait FooBase),This,TypeBounds(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing),LazyRef(null))),RefinedType(TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),trait FooBase),This,TypeBounds(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing),LazyRef(null)))),TypeRef(ThisType(TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),trait FooBase)),type This)))]], frozen = true
assertion failure for FooBase.this.This <:< FooBase, frozen = true
assertion failure for type bounds [[cannot display due to assertion failed, raw string = TypeBounds(OrType(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing),TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing)),AndType(AndType(RefinedType(TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),trait FooBase),This,TypeBounds(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing),LazyRef(null))),RefinedType(TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),trait FooBase),This,TypeBounds(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing),LazyRef(null)))),TypeRef(ThisType(TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),trait FooBase)),type This)))]] <:< type bounds [[cannot display due to assertion failed, raw string = TypeBounds(OrType(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing),TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing)),AndType(AndType(RefinedType(TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),trait FooBase),This,TypeBounds(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing),LazyRef(null))),RefinedType(TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),trait FooBase),This,TypeBounds(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing),LazyRef(null)))),TypeRef(ThisType(TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),trait FooBase)),type This)))]], frozen = true
assertion failure for type bounds [[cannot display due to assertion failed, raw string = TypeBounds(OrType(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing),TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing)),AndType(AndType(RefinedType(TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),trait FooBase),This,TypeBounds(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing),LazyRef(null))),RefinedType(TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),trait FooBase),This,TypeBounds(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing),LazyRef(null)))),TypeRef(ThisType(TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),trait FooBase)),type This)))]] <:< type bounds [[cannot display due to assertion failed, raw string = TypeBounds(OrType(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing),TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing)),AndType(AndType(RefinedType(TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),trait FooBase),This,TypeBounds(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing),LazyRef(null))),RefinedType(TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),trait FooBase),This,TypeBounds(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing),LazyRef(null)))),TypeRef(ThisType(TypeRef(ThisType(TypeRef(NoPrefix,module class <empty>)),trait FooBase)),type This)))]], frozen = true
error while transforming FooBase
{
type This >: Nothing <: FooBase.this.This
}
&
FooBase
{
type This >: Nothing <: FooBase.this.This
}
error while transforming >: Nothing <:
FooBase
{
type This >: Nothing <: FooBase.this.This
}
&
FooBase
{
type This >: Nothing <: FooBase.this.This
}
error while transforming type This
>: Nothing <:
FooBase
{
type This >: Nothing <: FooBase.this.This
}
&
FooBase
{
type This >: Nothing <: FooBase.this.This
}
error while transforming () extends Object {
type This
>: Nothing <:
FooBase
{
type This >: Nothing <: FooBase.this.This
}
&
FooBase
{
type This >: Nothing <: FooBase.this.This
}
}
error while transforming @scala.annotation.internal.SourceFile("investigate/LazyRef.scala") trait FooBase() extends Object {
type This
>: Nothing <:
FooBase
{
type This >: Nothing <: FooBase.this.This
}
&
FooBase
{
type This >: Nothing <: FooBase.this.This
}
}
error while transforming package <empty> {
@scala.annotation.internal.SourceFile("investigate/LazyRef.scala") trait FooBase() extends Object {
type This
>: Nothing <:
FooBase
{
type This >: Nothing <: FooBase.this.This
}
&
FooBase
{
type This >: Nothing <: FooBase.this.This
}
}
}
exception occurred while compiling investigate/LazyRef.scala
Exception in thread "main" java.lang.AssertionError: assertion failed while compiling investigate/LazyRef.scala
java.lang.AssertionError: assertion failed
at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:11)
at dotty.tools.dotc.core.Types$LazyRef.ref(Types.scala:2802)
at dotty.tools.dotc.core.Types$LazyRef.underlying(Types.scala:2823)
at dotty.tools.dotc.core.Types$Type.typeSymbol(Types.scala:473)
at dotty.tools.dotc.core.Types$Type.isFromJavaObject(Types.scala:298)
at dotty.tools.dotc.printing.PlainPrinter.toTextRHS$$anonfun$1(PlainPrinter.scala:382)
at dotty.tools.dotc.printing.MessageLimiter.controlled(MessageLimiter.scala:23)
at dotty.tools.dotc.printing.PlainPrinter.controlled(PlainPrinter.scala:36)
at dotty.tools.dotc.printing.PlainPrinter.toTextRHS(PlainPrinter.scala:407)
at dotty.tools.dotc.printing.PlainPrinter.toTextRefinement(PlainPrinter.scala:110)
at dotty.tools.dotc.printing.PlainPrinter.toText$$anonfun$3$$anonfun$1(PlainPrinter.scala:167)
at scala.collection.immutable.List.map(List.scala:246)
at dotty.tools.dotc.printing.PlainPrinter.toText$$anonfun$1(PlainPrinter.scala:167)
at dotty.tools.dotc.printing.MessageLimiter.controlled(MessageLimiter.scala:23)
at dotty.tools.dotc.printing.PlainPrinter.controlled(PlainPrinter.scala:36)
at dotty.tools.dotc.printing.PlainPrinter.toText(PlainPrinter.scala:248)
at dotty.tools.dotc.printing.RefinedPrinter.toText$$anonfun$1(RefinedPrinter.scala:266)
at dotty.tools.dotc.printing.MessageLimiter.controlled(MessageLimiter.scala:23)
at dotty.tools.dotc.printing.PlainPrinter.controlled(PlainPrinter.scala:36)
at dotty.tools.dotc.printing.RefinedPrinter.toText(RefinedPrinter.scala:268)
at dotty.tools.dotc.printing.PlainPrinter.argText(PlainPrinter.scala:114)
at dotty.tools.dotc.printing.RefinedPrinter.toTextInfixType$1$$anonfun$1$$anonfun$1(RefinedPrinter.scala:191)
at dotty.tools.dotc.printing.Printer.atPrec(Printer.scala:42)
at dotty.tools.dotc.printing.RefinedPrinter.toTextInfixType$3$$anonfun$3(RefinedPrinter.scala:191)
at dotty.tools.dotc.printing.Printer.atPrec(Printer.scala:42)
at dotty.tools.dotc.printing.Printer.changePrec(Printer.scala:71)
at dotty.tools.dotc.printing.RefinedPrinter.toTextInfixType$4(RefinedPrinter.scala:192)
at dotty.tools.dotc.printing.RefinedPrinter.toText$$anonfun$1(RefinedPrinter.scala:216)
at dotty.tools.dotc.printing.MessageLimiter.controlled(MessageLimiter.scala:23)
at dotty.tools.dotc.printing.PlainPrinter.controlled(PlainPrinter.scala:36)
at dotty.tools.dotc.printing.RefinedPrinter.toText(RefinedPrinter.scala:268)
at dotty.tools.dotc.core.Types$Type.toText(Types.scala:1803)
at dotty.tools.dotc.printing.Showable.show(Showable.scala:23)
at dotty.tools.dotc.printing.Showable.show$(Showable.scala:9)
at dotty.tools.dotc.core.Types$Type.show(Types.scala:93)
at dotty.tools.dotc.core.TypeComparer$.show(TypeComparer.scala:2603)
at dotty.tools.dotc.core.TypeComparer.showGoal$$anonfun$1(TypeComparer.scala:2368)
at dotty.tools.dotc.reporting.NoExplanation.msg(Message.scala:130)
at dotty.tools.dotc.reporting.Message.message(Message.scala:85)
at dotty.tools.dotc.reporting.Message.isNonSensical(Message.scala:97)
at dotty.tools.dotc.reporting.HideNonSensicalMessages.isHidden(HideNonSensicalMessages.scala:16)
at dotty.tools.dotc.reporting.HideNonSensicalMessages.isHidden$(HideNonSensicalMessages.scala:10)
at dotty.tools.dotc.reporting.AbstractReporter.isHidden(AbstractReporter.scala:8)
at dotty.tools.dotc.reporting.Reporter.report(Reporter.scala:148)
at dotty.tools.dotc.report$.echo(report.scala:21)
at dotty.tools.dotc.core.TypeComparer.showGoal(TypeComparer.scala:2368)
at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1291)
at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:187)
at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:197)
at dotty.tools.dotc.core.TypeComparer.isSub(TypeComparer.scala:199)
at dotty.tools.dotc.core.ConstraintHandling.op$proxy6$1(ConstraintHandling.scala:222)
at dotty.tools.dotc.core.ConstraintHandling.isSubTypeWhenFrozen(ConstraintHandling.scala:222)
at dotty.tools.dotc.core.ConstraintHandling.isSubTypeWhenFrozen$(ConstraintHandling.scala:26)
at dotty.tools.dotc.core.TypeComparer.isSubTypeWhenFrozen(TypeComparer.scala:30)
at dotty.tools.dotc.core.TypeComparer$.isSubTypeWhenFrozen(TypeComparer.scala:2650)
at dotty.tools.dotc.core.Types$Type.frozen_$less$colon$less(Types.scala:1023)
at dotty.tools.dotc.core.Types$TypeBounds.$amp(Types.scala:4720)
at dotty.tools.dotc.core.Types$TypeBounds.$amp(Types.scala:4730)
at dotty.tools.dotc.core.Types$Type.recoverable_$amp(Types.scala:1143)
at dotty.tools.dotc.core.Types$Type.goRefined$1(Types.scala:771)
at dotty.tools.dotc.core.Types$Type.go$1(Types.scala:690)
at dotty.tools.dotc.core.Types$Type.findMember(Types.scala:857)
at dotty.tools.dotc.core.Types$Type.memberBasedOnFlags(Types.scala:654)
at dotty.tools.dotc.core.Types$Type.nonPrivateMember(Types.scala:644)
at dotty.tools.dotc.core.Types$abstractTypeNameFilter$.apply(Types.scala:5825)
at dotty.tools.dotc.core.Types$Type.memberNames$$anonfun$1(Types.scala:887)
at scala.collection.immutable.Set$Set1.filterImpl(Set.scala:172)
at scala.collection.immutable.Set$Set1.filterImpl(Set.scala:156)
at scala.collection.StrictOptimizedIterableOps.filter(StrictOptimizedIterableOps.scala:217)
at scala.collection.StrictOptimizedIterableOps.filter$(StrictOptimizedIterableOps.scala:217)
at scala.collection.immutable.Set$Set1.filter(Set.scala:156)
at dotty.tools.dotc.core.Types$Type.memberNames(Types.scala:887)
at dotty.tools.dotc.core.Types$Type.memberNames(Types.scala:889)
at dotty.tools.dotc.core.Types$Type.memberDenots(Types.scala:903)
at dotty.tools.dotc.core.Types$Type.abstractTypeMembers(Types.scala:938)
at dotty.tools.dotc.typer.Checking$.$anonfun$3(Checking.scala:407)
at scala.collection.immutable.List.flatMap(List.scala:293)
at dotty.tools.dotc.typer.Checking$.checkNonCyclicInherited(Checking.scala:408)
at dotty.tools.dotc.transform.PostTyper$PostTyperTransformer.transform(PostTyper.scala:372)
at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1389)
at dotty.tools.dotc.transform.MacroTransform$Transformer.transform(MacroTransform.scala:60)
at dotty.tools.dotc.transform.PostTyper$PostTyperTransformer.transform(PostTyper.scala:426)
at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1410)
at dotty.tools.dotc.transform.MacroTransform$Transformer.transform(MacroTransform.scala:51)
at dotty.tools.dotc.transform.PostTyper$PostTyperTransformer.transform(PostTyper.scala:361)
at dotty.tools.dotc.transform.MacroTransform$Transformer.transformStat$1(MacroTransform.scala:39)
at dotty.tools.dotc.transform.MacroTransform$Transformer.transformStats$$anonfun$1(MacroTransform.scala:42)
at dotty.tools.dotc.core.Decorators$ListDecorator$.loop$1(Decorators.scala:92)
at dotty.tools.dotc.core.Decorators$ListDecorator$.mapconserve$extension(Decorators.scala:108)
at dotty.tools.dotc.transform.MacroTransform$Transformer.transformStats(MacroTransform.scala:42)
at dotty.tools.dotc.transform.MacroTransform$Transformer.transform(MacroTransform.scala:58)
at dotty.tools.dotc.transform.PostTyper$PostTyperTransformer.transform$$anonfun$8$$anonfun$1(PostTyper.scala:335)
at dotty.tools.dotc.transform.SuperAccessors.wrapTemplate(SuperAccessors.scala:210)
at dotty.tools.dotc.transform.PostTyper$PostTyperTransformer.transform$$anonfun$4(PostTyper.scala:335)
at dotty.tools.dotc.transform.PostTyper$PostTyperTransformer.withNoCheckNews(PostTyper.scala:98)
at dotty.tools.dotc.transform.PostTyper$PostTyperTransformer.transform(PostTyper.scala:337)
at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1410)
at dotty.tools.dotc.transform.MacroTransform$Transformer.transform(MacroTransform.scala:51)
at dotty.tools.dotc.transform.PostTyper$PostTyperTransformer.transform(PostTyper.scala:361)
at dotty.tools.dotc.transform.MacroTransform$Transformer.transformStat$1(MacroTransform.scala:39)
at dotty.tools.dotc.transform.MacroTransform$Transformer.transformStats$$anonfun$1(MacroTransform.scala:42)
at dotty.tools.dotc.core.Decorators$ListDecorator$.loop$1(Decorators.scala:92)
at dotty.tools.dotc.core.Decorators$ListDecorator$.mapconserve$extension(Decorators.scala:108)
at dotty.tools.dotc.transform.MacroTransform$Transformer.transformStats(MacroTransform.scala:42)
at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1421)
at dotty.tools.dotc.transform.MacroTransform$Transformer.transform(MacroTransform.scala:51)
at dotty.tools.dotc.transform.PostTyper$PostTyperTransformer.transform(PostTyper.scala:426)
at dotty.tools.dotc.transform.MacroTransform.run(MacroTransform.scala:21)
at dotty.tools.dotc.core.Phases$Phase.runOn$$anonfun$1(Phases.scala:303)
at scala.collection.immutable.List.map(List.scala:246)
at dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:304)
at dotty.tools.dotc.Run.runPhases$4$$anonfun$4(Run.scala:205)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at scala.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:215)
at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:223)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:67)
at dotty.tools.dotc.Run.compileUnits(Run.scala:230)
at dotty.tools.dotc.Run.compileSources(Run.scala:166)
at dotty.tools.dotc.Run.compile(Run.scala:150)
at dotty.tools.dotc.Driver.doCompile(Driver.scala:39)
at dotty.tools.dotc.Driver.process(Driver.scala:198)
at dotty.tools.dotc.Driver.process(Driver.scala:166)
at dotty.tools.dotc.Driver.process(Driver.scala:178)
at dotty.tools.dotc.Driver.main(Driver.scala:208)
at dotty.tools.dotc.Main.main(Main.scala)
[error] Nonzero exit code returned from runner: 1
[error] (scala3-compiler / Compile / runMain) Nonzero exit code returned from runner: 1
[error] Total time: 5 s, completed May 31, 2021, 12:25:21 AM
Expectation
The code should compile without crashing.
Note that it seems that the backtrace shows an exception happens when we are handling another exception. If we print out the real exception here, we find that the error occurs when computing LazyRef
s.