diff --git a/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala b/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala index 65d8abfdf6a7..b00c10503b70 100644 --- a/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala +++ b/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala @@ -249,7 +249,7 @@ trait QuotesAndSplices { val pat1 = if (patType eq patType1) pat else pat.withType(patType1) patBuf += pat1 } - case Select(pat, _) if tree.symbol.isTypeSplice => + case Select(pat: Bind, _) if tree.symbol.isTypeSplice => val sym = tree.tpe.dealias.typeSymbol if sym.exists then val tdef = TypeDef(sym.asType).withSpan(sym.span) diff --git a/tests/pos-macros/i17039.scala b/tests/pos-macros/i17039.scala new file mode 100644 index 000000000000..6f983b138526 --- /dev/null +++ b/tests/pos-macros/i17039.scala @@ -0,0 +1,7 @@ +import scala.quoted.* + +def macroImpl(using Quotes) = + val t = summon[Type[Int]] + Type.of[Int] match + case '[t.Underlying] => '{true} + case _ => '{false}