Closed
Description
Compiler version
3.3.0-RC2
Minimized code
import scala.quoted.*
trait Foo
object Foo:
inline given foo[T <: Foo]: T = summon[Type.of[T]]
Output (click arrow to expand)
Exception in thread "main" scala.MatchError: Literal(Constant(null)) (of class dotty.tools.dotc.ast.Trees$Literal) while compiling tests/pos-macros/i15685.scala
scala.MatchError: Literal(Constant(null)) (of class dotty.tools.dotc.ast.Trees$Literal)
at dotty.tools.dotc.ast.tpd$.TypeApply(tpd.scala:55)
at dotty.tools.dotc.ast.tpd$TreeOps$.appliedToTypeTrees$extension(tpd.scala:973)
at dotty.tools.dotc.typer.Typer.adapt1(Typer.scala:4122)
at dotty.tools.dotc.typer.Typer.adapt(Typer.scala:3457)
at dotty.tools.dotc.typer.ProtoTypes$FunProto.typedArg(ProtoTypes.scala:497)
at dotty.tools.dotc.typer.Applications$ApplyToUntyped.typedArg(Applications.scala:897)
at dotty.tools.dotc.typer.Applications$ApplyToUntyped.typedArg(Applications.scala:897)
at dotty.tools.dotc.typer.Applications$Application.addTyped$1(Applications.scala:589)
at dotty.tools.dotc.typer.Applications$Application.matchArgs(Applications.scala:653)
at dotty.tools.dotc.typer.Applications$Application.init(Applications.scala:492)
at dotty.tools.dotc.typer.Applications$TypedApply.<init>(Applications.scala:779)
at dotty.tools.dotc.typer.Applications$ApplyToUntyped.<init>(Applications.scala:896)
at dotty.tools.dotc.typer.Applications.ApplyTo(Applications.scala:1126)
at dotty.tools.dotc.typer.Applications.ApplyTo$(Applications.scala:352)
at dotty.tools.dotc.typer.Typer.ApplyTo(Typer.scala:115)
at dotty.tools.dotc.typer.Applications.simpleApply$1(Applications.scala:969)
at dotty.tools.dotc.typer.Applications.realApply$1$$anonfun$2(Applications.scala:1052)
at dotty.tools.dotc.typer.Typer.tryEither(Typer.scala:3220)
at dotty.tools.dotc.typer.Applications.realApply$1(Applications.scala:1063)
at dotty.tools.dotc.typer.Applications.typedApply(Applications.scala:1101)
at dotty.tools.dotc.typer.Applications.typedApply$(Applications.scala:352)
at dotty.tools.dotc.typer.Typer.typedApply(Typer.scala:115)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2950)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3013)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3080)
at dotty.tools.dotc.typer.Implicits.tryConversion$1(Implicits.scala:1124)
at dotty.tools.dotc.typer.Implicits.typedImplicit(Implicits.scala:1155)
at dotty.tools.dotc.typer.Implicits.typedImplicit$(Implicits.scala:806)
at dotty.tools.dotc.typer.Typer.typedImplicit(Typer.scala:115)
at dotty.tools.dotc.typer.Implicits$ImplicitSearch.tryImplicit(Implicits.scala:1227)
at dotty.tools.dotc.typer.Implicits$ImplicitSearch.rank$1(Implicits.scala:1326)
at dotty.tools.dotc.typer.Implicits$ImplicitSearch.searchImplicit(Implicits.scala:1496)
at dotty.tools.dotc.typer.Implicits$ImplicitSearch.searchImplicit(Implicits.scala:1524)
at dotty.tools.dotc.typer.Implicits$ImplicitSearch.bestImplicit(Implicits.scala:1557)
at dotty.tools.dotc.typer.Implicits.inferImplicit(Implicits.scala:1048)
at dotty.tools.dotc.typer.Implicits.inferImplicit$(Implicits.scala:806)
at dotty.tools.dotc.typer.Typer.inferImplicit(Typer.scala:115)
at dotty.tools.dotc.typer.Implicits.inferView(Implicits.scala:844)
at dotty.tools.dotc.typer.Implicits.inferView$(Implicits.scala:806)
at dotty.tools.dotc.typer.Typer.inferView(Typer.scala:115)
at dotty.tools.dotc.typer.Implicits.viewExists(Implicits.scala:819)
at dotty.tools.dotc.typer.Implicits.viewExists$(Implicits.scala:806)
at dotty.tools.dotc.typer.Typer.viewExists(Typer.scala:115)
at dotty.tools.dotc.typer.Implicits.ignoredConvertibleImplicits$1$$anonfun$3(Implicits.scala:948)
at scala.collection.Iterator$$anon$6.hasNext(Iterator.scala:479)
at scala.collection.Iterator.isEmpty(Iterator.scala:466)
at scala.collection.Iterator.isEmpty$(Iterator.scala:466)
at scala.collection.AbstractIterator.isEmpty(Iterator.scala:1300)
at scala.collection.View$Filter.isEmpty(View.scala:146)
at scala.collection.IterableOnceOps.nonEmpty(IterableOnce.scala:833)
at scala.collection.IterableOnceOps.nonEmpty$(IterableOnce.scala:833)
at scala.collection.AbstractIterable.nonEmpty(Iterable.scala:933)
at dotty.tools.dotc.reporting.MissingImplicitArgument.noChainConversionsNote$1(messages.scala:2750)
at dotty.tools.dotc.reporting.MissingImplicitArgument.msgPostscript$$anonfun$4(messages.scala:2758)
at scala.Option.orElse(Option.scala:477)
at dotty.tools.dotc.reporting.MissingImplicitArgument.msgPostscript(messages.scala:2758)
at dotty.tools.dotc.reporting.Message.message$$anonfun$1(Message.scala:345)
at dotty.tools.dotc.reporting.Message.inMessageContext(Message.scala:341)
at dotty.tools.dotc.reporting.Message.message(Message.scala:345)
at dotty.tools.dotc.reporting.Message.isNonSensical(Message.scala:322)
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.issueUnconfigured(Reporter.scala:156)
at dotty.tools.dotc.reporting.Reporter.go$1(Reporter.scala:181)
at dotty.tools.dotc.reporting.Reporter.issueIfNotSuppressed(Reporter.scala:200)
at dotty.tools.dotc.reporting.Reporter.report(Reporter.scala:203)
at dotty.tools.dotc.report$.error(report.scala:69)
at dotty.tools.dotc.typer.Typer.issueErrors$1$$anonfun$1(Typer.scala:3678)
at scala.runtime.function.JProcedure3.apply(JProcedure3.java:15)
at scala.runtime.function.JProcedure3.apply(JProcedure3.java:10)
at scala.collection.LazyZip3.foreach(LazyZipOps.scala:248)
at dotty.tools.dotc.typer.Typer.issueErrors$1(Typer.scala:3680)
at dotty.tools.dotc.typer.Typer.addImplicitArgs$1(Typer.scala:3702)
at dotty.tools.dotc.typer.Typer.adaptNoArgsImplicitMethod$1(Typer.scala:3719)
at dotty.tools.dotc.typer.Typer.adaptNoArgs$1(Typer.scala:3908)
at dotty.tools.dotc.typer.Typer.adapt1(Typer.scala:4135)
at dotty.tools.dotc.typer.Typer.adapt(Typer.scala:3457)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3080)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3084)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3196)
at dotty.tools.dotc.typer.Typer.$anonfun$50(Typer.scala:2404)
at dotty.tools.dotc.inlines.PrepareInlineable$.dropInlineIfError(PrepareInlineable.scala:249)
at dotty.tools.dotc.typer.Typer.typedDefDef(Typer.scala:2404)
at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2926)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3012)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3080)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3084)
at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3106)
at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3152)
at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:2584)
at dotty.tools.dotc.typer.Typer.typedTypeOrClassDef$1(Typer.scala:2938)
at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2942)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3012)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3080)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3084)
at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3106)
at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3152)
at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:2714)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2983)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3013)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3080)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3084)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3196)
at dotty.tools.dotc.typer.TyperPhase.typeCheck$$anonfun$1(TyperPhase.scala:44)
at dotty.tools.dotc.typer.TyperPhase.typeCheck$$anonfun$adapted$1(TyperPhase.scala:54)
at scala.Function0.apply$mcV$sp(Function0.scala:42)
at dotty.tools.dotc.core.Phases$Phase.monitor(Phases.scala:437)
at dotty.tools.dotc.typer.TyperPhase.typeCheck(TyperPhase.scala:54)
at dotty.tools.dotc.typer.TyperPhase.runOn$$anonfun$3(TyperPhase.scala:88)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.immutable.List.foreach(List.scala:333)
at dotty.tools.dotc.typer.TyperPhase.runOn(TyperPhase.scala:88)
at dotty.tools.dotc.Run.runPhases$1$$anonfun$1(Run.scala:247)
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:1321)
at dotty.tools.dotc.Run.runPhases$1(Run.scala:263)
at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:271)
at dotty.tools.dotc.Run.compileUnits$$anonfun$adapted$1(Run.scala:280)
at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:67)
at dotty.tools.dotc.Run.compileUnits(Run.scala:280)
at dotty.tools.dotc.Run.compileSources(Run.scala:195)
at dotty.tools.dotc.Run.compile(Run.scala:179)
at dotty.tools.dotc.Driver.doCompile(Driver.scala:35)
at dotty.tools.dotc.Driver.process(Driver.scala:195)
at dotty.tools.dotc.Driver.process(Driver.scala:163)
at dotty.tools.dotc.Driver.process(Driver.scala:175)
at dotty.tools.dotc.Driver.main(Driver.scala:205)
at dotty.tools.dotc.Main.main(Main.scala)