Skip to content

Crash involving summoning and cyclic givens #7248

Closed
@anatoliykmetyuk

Description

@anatoliykmetyuk

minimized code

given [H](given h: H): H = h
@main def Test = summon[Int]
Stack trace
exception occurred while typechecking ../pg/Main.scala
exception occurred while compiling ../pg/Main.scala
java.lang.AssertionError: assertion failed: NoType while compiling ../pg/Main.scala
Exception in thread "main" java.lang.AssertionError: assertion failed: NoType
	at dotty.DottyPredef$.assertFail(DottyPredef.scala:17)
	at dotty.tools.dotc.core.Types$TypeBounds.<init>(Types.scala:4076)
	at dotty.tools.dotc.core.Types$AliasingBounds.<init>(Types.scala:4140)
	at dotty.tools.dotc.core.Types$TypeAlias.<init>(Types.scala:4162)
	at dotty.tools.dotc.core.Types$TypeAlias$.apply(Types.scala:4188)
	at dotty.tools.dotc.core.Types$Type.bounds(Types.scala:1422)
	at dotty.tools.dotc.typer.Typer.decomposeProtoFunction(Typer.scala:849)
	at dotty.tools.dotc.typer.Typer.typedFunctionValue(Typer.scala:922)
	at dotty.tools.dotc.typer.Typer.typedFunction(Typer.scala:857)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2071)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2117)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2153)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2165)
	at dotty.tools.dotc.typer.Typer.adaptNoArgsUnappliedMethod$2(Typer.scala:2703)
	at dotty.tools.dotc.typer.Typer.adaptNoArgs$1(Typer.scala:2838)
	at dotty.tools.dotc.typer.Typer.adapt1(Typer.scala:3046)
	at dotty.tools.dotc.typer.Typer.adapt(Typer.scala:2452)
	at dotty.tools.dotc.typer.Implicits$ImplicitSearch.typedImplicit(Implicits.scala:1371)
	at dotty.tools.dotc.typer.Implicits$ImplicitSearch.tryImplicit(Implicits.scala:1427)
	at dotty.tools.dotc.typer.Implicits$ImplicitSearch.rank$1(Implicits.scala:1495)
	at dotty.tools.dotc.typer.Implicits$ImplicitSearch.searchImplicits(Implicits.scala:1588)
	at dotty.tools.dotc.typer.Implicits$ImplicitSearch.bestImplicit(Implicits.scala:1609)
	at dotty.tools.dotc.typer.Implicits.inferImplicit(Implicits.scala:1301)
	at dotty.tools.dotc.typer.Typer.inferImplicit(Typer.scala:83)
	at dotty.tools.dotc.typer.Implicits.hiddenImplicitsAddendum$1(Implicits.scala:1219)
	at dotty.tools.dotc.typer.Implicits.missingArgMsg(Implicits.scala:1230)
	at dotty.tools.dotc.typer.Typer.missingArgMsg(Typer.scala:83)
	at dotty.tools.dotc.typer.Typer.issueErrors$1$$anonfun$1$$anonfun$1(Typer.scala:2603)
	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.AbstractReporter.isHidden(AbstractReporter.scala:8)
	at dotty.tools.dotc.reporting.Reporter.report(Reporter.scala:271)
	at dotty.tools.dotc.reporting.Reporting.error(Reporter.scala:135)
	at dotty.tools.dotc.core.Contexts$Context.error(Contexts.scala:71)
	at dotty.tools.dotc.typer.Typer.issueErrors$2$$anonfun$2(Typer.scala:2602)
	at dotty.runtime.function.JProcedure3.apply(JProcedure3.java:15)
	at dotty.runtime.function.JProcedure3.apply(JProcedure3.java:10)
	at scala.collection.LazyZip3.foreach(LazyZipOps.scala:248)
	at dotty.tools.dotc.typer.Typer.issueErrors$3(Typer.scala:2606)
	at dotty.tools.dotc.typer.Typer.addImplicitArgs$4(Typer.scala:2632)
	at dotty.tools.dotc.typer.Typer.adaptNoArgsImplicitMethod$2(Typer.scala:2647)
	at dotty.tools.dotc.typer.Typer.adaptNoArgs$1(Typer.scala:2818)
	at dotty.tools.dotc.typer.Typer.adapt1(Typer.scala:3046)
	at dotty.tools.dotc.typer.Typer.adapt(Typer.scala:2452)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2153)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2165)
	at dotty.tools.dotc.typer.Namer.typedAheadExpr$$anonfun$1(Namer.scala:1211)
	at dotty.tools.dotc.typer.Namer.typedAhead(Namer.scala:1201)
	at dotty.tools.dotc.typer.Namer.typedAheadExpr(Namer.scala:1211)
	at dotty.tools.dotc.typer.Namer.rhsType$2(Namer.scala:1346)
	at dotty.tools.dotc.typer.Namer.cookedRhsType$1(Namer.scala:1357)
	at dotty.tools.dotc.typer.Namer.lhsType$1(Namer.scala:1358)
	at dotty.tools.dotc.typer.Namer.inferredType$1(Namer.scala:1369)
	at dotty.tools.dotc.typer.Namer.valOrDefDefSig(Namer.scala:1377)
	at dotty.tools.dotc.typer.Namer.defDefSig(Namer.scala:1446)
	at dotty.tools.dotc.typer.Namer$Completer.typeSig(Namer.scala:769)
	at dotty.tools.dotc.typer.Namer$Completer.completeInCreationContext(Namer.scala:886)
	at dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:796)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:257)
	at dotty.tools.dotc.core.Denotations$Denotation.completeInfo$1(Denotations.scala:182)
	at dotty.tools.dotc.core.Denotations$Denotation.info(Denotations.scala:184)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:397)
	at dotty.tools.dotc.typer.Typer.retrieveSym(Typer.scala:2013)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2038)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2116)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2153)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2165)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2184)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2228)
	at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:1727)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2051)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2116)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2153)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2165)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2184)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2228)
	at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:1852)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2092)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2117)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2153)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2165)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2241)
	at dotty.tools.dotc.typer.FrontEnd.typeCheck$$anonfun$1(FrontEnd.scala:75)
	at dotty.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
	at dotty.tools.dotc.typer.FrontEnd.monitor(FrontEnd.scala:41)
	at dotty.tools.dotc.typer.FrontEnd.typeCheck(FrontEnd.scala:79)
	at dotty.tools.dotc.typer.FrontEnd.runOn$$anonfun$3(FrontEnd.scala:109)
	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:312)
	at dotty.tools.dotc.typer.FrontEnd.runOn(FrontEnd.scala:109)
	at dotty.tools.dotc.Run.runPhases$4$$anonfun$4(Run.scala:159)
	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:1350)
	at dotty.tools.dotc.Run.runPhases$5(Run.scala:169)
	at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:177)
	at dotty.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
	at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:67)
	at dotty.tools.dotc.Run.compileUnits(Run.scala:184)
	at dotty.tools.dotc.Run.compileSources(Run.scala:121)
	at dotty.tools.dotc.Run.compile(Run.scala:104)
	at dotty.tools.dotc.Driver.doCompile(Driver.scala:35)
	at dotty.tools.dotc.Driver.process(Driver.scala:178)
	at dotty.tools.dotc.Driver.process(Driver.scala:147)
	at dotty.tools.dotc.Driver.process(Driver.scala:159)
	at dotty.tools.dotc.Driver.main(Driver.scala:186)
	at dotty.tools.dotc.Main.main(Main.scala)
[error] Nonzero exit code returned from runner: 1
[error] (dotty-compiler / Compile / runMain) Nonzero exit code returned from runner: 1
[error] Total time: 14 s, completed Sep 18, 2019 3:17:11 PM

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions