diff --git a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala index 1501b07c6bde..cac0335177d9 100644 --- a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala +++ b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala @@ -2167,11 +2167,11 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler end extension end PolyTypeMethods - type TypeLambda = dotc.core.Types.TypeLambda + type TypeLambda = dotc.core.Types.HKTypeLambda object TypeLambdaTypeTest extends TypeTest[TypeRepr, TypeLambda]: def unapply(x: TypeRepr): Option[TypeLambda & x.type] = x match - case tpe: (Types.TypeLambda & x.type) => Some(tpe) + case tpe: (Types.HKTypeLambda & x.type) => Some(tpe) case _ => None end TypeLambdaTypeTest diff --git a/tests/pos-macros/i16961/Macro_1.scala b/tests/pos-macros/i16961/Macro_1.scala new file mode 100644 index 000000000000..20ec6b439ec8 --- /dev/null +++ b/tests/pos-macros/i16961/Macro_1.scala @@ -0,0 +1,10 @@ +import scala.quoted.* + +inline def myMacro = ${ myMacroImpl } + +def myMacroImpl(using Quotes) = + import quotes.reflect.* + + PolyType(List("arg"))(_ => List(TypeBounds.empty), _ => TypeRepr.of[Any]) match + case _: TypeLambda => quotes.reflect.report.errorAndAbort("PolyType should not be a TypeLambda") + case _ => '{ () } // Ok diff --git a/tests/pos-macros/i16961/Test_2.scala b/tests/pos-macros/i16961/Test_2.scala new file mode 100644 index 000000000000..76a9e17659db --- /dev/null +++ b/tests/pos-macros/i16961/Test_2.scala @@ -0,0 +1 @@ +def test = myMacro