Skip to content

Quoted pattern crashes if type is not not fully defined #6324

Closed
@nicolasstucki

Description

@nicolasstucki
def res(x: quoted.Expr[Int]) given tasty.Reflection: quoted.Expr[Int] = x match {
  case '{ 1 + $b } => b
}
java.lang.Error: internal error: type of quoted pattern selector ? is not fully defined, pos = [1330..1332] while compiling tests/pos/quotedPatterns.scala
Exception in thread "main" java.lang.Error: internal error: type of quoted pattern selector ? is not fully defined, pos = [1330..1332]
	at dotty.tools.dotc.typer.Inferencing$.fullyDefinedType(Inferencing.scala:43)
	at dotty.tools.dotc.typer.Typer.$anonfun$typedSplice$1(Typer.scala:2014)
	at dotty.tools.dotc.util.Stats$.track(Stats.scala:37)
	at dotty.tools.dotc.typer.Typer.typedSplice(Typer.scala:2006)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2135)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2149)
	at dotty.tools.dotc.typer.Typer.$anonfun$typed$2(Typer.scala:2183)
	at dotty.tools.dotc.reporting.TraceSyntax.apply(trace.scala:56)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2176)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2195)
	at dotty.tools.dotc.typer.ProtoTypes$FunProto.$anonfun$unforcedTypedArgs$2(ProtoTypes.scala:314)
	at dotty.tools.dotc.typer.ProtoTypes$FunProto.cacheTypedArg(ProtoTypes.scala:291)
	at dotty.tools.dotc.typer.ProtoTypes$FunProto.$anonfun$unforcedTypedArgs$1(ProtoTypes.scala:314)
	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.typer.ProtoTypes$FunProto.unforcedTypedArgs(ProtoTypes.scala:314)
	at dotty.tools.dotc.typer.Applications.$anonfun$resolveOverloaded$5(Applications.scala:1621)
	at dotty.tools.dotc.util.Stats$.track(Stats.scala:37)
	at dotty.tools.dotc.typer.Applications.resolveOverloaded(Applications.scala:1539)
	at dotty.tools.dotc.typer.Applications.$anonfun$resolveOverloaded$1(Applications.scala:1525)
	at dotty.tools.dotc.util.Stats$.track(Stats.scala:37)
	at dotty.tools.dotc.typer.Applications.resolveOverloaded(Applications.scala:1480)
	at dotty.tools.dotc.typer.Applications.resolveOverloaded$(Applications.scala:1480)
	at dotty.tools.dotc.typer.Typer.resolveOverloaded(Typer.scala:87)
	at dotty.tools.dotc.typer.Typer.adaptOverloaded$1(Typer.scala:2507)
	at dotty.tools.dotc.typer.Typer.adapt1(Typer.scala:3033)
	at dotty.tools.dotc.typer.Typer.$anonfun$adapt$3(Typer.scala:2481)
	at dotty.tools.dotc.reporting.TraceSyntax.apply(trace.scala:56)
	at dotty.tools.dotc.typer.Typer.$anonfun$adapt$1(Typer.scala:2480)
	at dotty.tools.dotc.util.Stats$.track(Stats.scala:37)
	at dotty.tools.dotc.typer.Typer.adapt(Typer.scala:2480)
	at dotty.tools.dotc.typer.Typer.$anonfun$typed$2(Typer.scala:2183)
	at dotty.tools.dotc.reporting.TraceSyntax.apply(trace.scala:56)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions