Skip to content

assertion failed: unreachable in Formatting$.needsExplanation$1 #4377

Closed
@sir-wabbit

Description

@sir-wabbit
object App {
  type T[A <: ((a : A) => a.type)] = A
  val a: T[_] = ???
}
Exception in thread "main" java.lang.AssertionError: assertion failed: unreachable
	at scala.Predef$.assert(Predef.scala:219)
	at dotty.tools.dotc.printing.Formatting$.needsExplanation$1(Formatting.scala:194)
	at dotty.tools.dotc.printing.Formatting$.$anonfun$explanations$2(Formatting.scala:200)
	at scala.collection.immutable.List.flatMap(List.scala:335)
	at dotty.tools.dotc.printing.Formatting$.explanations(Formatting.scala:198)
	at dotty.tools.dotc.printing.Formatting$.explained(Formatting.scala:235)
	at dotty.tools.dotc.core.Decorators$StringInterpolators$.ex$extension(Decorators.scala:198)
	at dotty.tools.dotc.typer.Checking$.$anonfun$checkAppliedType$7(Checking.scala:93)
	at dotty.tools.dotc.reporting.diagnostic.MessageContainer.contained(MessageContainer.scala:59)
	at dotty.tools.dotc.reporting.diagnostic.MessageContainer.message(MessageContainer.scala:42)
	at dotty.tools.dotc.reporting.diagnostic.MessageContainer.isNonSensical(MessageContainer.scala:71)
	at dotty.tools.dotc.reporting.HideNonSensicalMessages.isHidden(HideNonSensicalMessages.scala:17)
	at dotty.tools.dotc.reporting.HideNonSensicalMessages.isHidden$(HideNonSensicalMessages.scala:15)
	at dotty.tools.dotc.reporting.ConsoleReporter.isHidden(ConsoleReporter.scala:13)
	at dotty.tools.dotc.reporting.Reporter.report(Reporter.scala:181)
	at dotty.tools.dotc.reporting.Reporting.error(Reporter.scala:88)
	at dotty.tools.dotc.reporting.Reporting.error$(Reporter.scala:87)
	at dotty.tools.dotc.core.Contexts$Context.error(Contexts.scala:71)
	at dotty.tools.dotc.reporting.Reporting.errorOrMigrationWarning(Reporter.scala:91)
	at dotty.tools.dotc.reporting.Reporting.errorOrMigrationWarning$(Reporter.scala:90)
	at dotty.tools.dotc.core.Contexts$Context.errorOrMigrationWarning(Contexts.scala:71)
	at dotty.tools.dotc.typer.Checking$.checkWildcardApply$1(Checking.scala:94)
	at dotty.tools.dotc.typer.Checking$.checkValidIfApply$1(Checking.scala:101)
	at dotty.tools.dotc.typer.Checking$.checkAppliedType(Checking.scala:102)
	at dotty.tools.dotc.transform.PostTyper$PostTyperTransformer.transform(PostTyper.scala:276)
	at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1203)
	at dotty.tools.dotc.transform.MacroTransform$Transformer.transform(MacroTransform.scala:54)
	at dotty.tools.dotc.transform.PostTyper$PostTyperTransformer.transform(PostTyper.scala:269)
	at dotty.tools.dotc.transform.MacroTransform$Transformer.transformStat$1(MacroTransform.scala:43)
	at dotty.tools.dotc.transform.MacroTransform$Transformer.$anonfun$transformStats$1(MacroTransform.scala:46)
	at dotty.tools.dotc.core.Decorators$ListDecorator$.loop$1(Decorators.scala:62)
	at dotty.tools.dotc.core.Decorators$ListDecorator$.mapconserve$extension(Decorators.scala:78)
	at dotty.tools.dotc.transform.MacroTransform$Transformer.transformStats(MacroTransform.scala:46)
	at dotty.tools.dotc.transform.MacroTransform$Transformer.transform(MacroTransform.scala:60)
	at dotty.tools.dotc.transform.PostTyper$PostTyperTransformer.super$transform(PostTyper.scala:210)
	at dotty.tools.dotc.transform.PostTyper$PostTyperTransformer.$anonfun$transform$5(PostTyper.scala:250)
	at dotty.tools.dotc.transform.SuperAccessors.wrapTemplate(SuperAccessors.scala:419)
	at dotty.tools.dotc.transform.PostTyper$PostTyperTransformer.$anonfun$transform$4(PostTyper.scala:249)
	at dotty.tools.dotc.transform.PostTyper$PostTyperTransformer.withNoCheckNews(PostTyper.scala:93)
	at dotty.tools.dotc.transform.PostTyper$PostTyperTransformer.transform(PostTyper.scala:246)
	at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1211)
	at dotty.tools.dotc.transform.MacroTransform$Transformer.transform(MacroTransform.scala:54)
	at dotty.tools.dotc.transform.PostTyper$PostTyperTransformer.transform(PostTyper.scala:266)
	at dotty.tools.dotc.ast.Trees$Instance$TreeMap.$anonfun$transform$6(Trees.scala:1231)
	at scala.collection.immutable.List.mapConserve(List.scala:176)
	at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1231)
	at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transformStats(Trees.scala:1229)
	at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1217)
	at dotty.tools.dotc.transform.MacroTransform$Transformer.transform(MacroTransform.scala:54)
	at dotty.tools.dotc.transform.PostTyper$PostTyperTransformer.transform(PostTyper.scala:315)
	at dotty.tools.dotc.transform.MacroTransform.run(MacroTransform.scala:22)
	at dotty.tools.dotc.core.Phases$Phase.$anonfun$runOn$1(Phases.scala:295)
	at scala.collection.immutable.List.map(List.scala:283)
	at dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:293)
	at dotty.tools.dotc.core.Phases$Phase.runOn$(Phases.scala:292)
	at dotty.tools.dotc.transform.MacroTransform.runOn(MacroTransform.scala:16)
	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:191)
	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)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions