diff --git a/tests/neg-macros/i8865.scala b/tests/neg-macros/i8865.scala new file mode 100644 index 000000000000..990cbd2cdb30 --- /dev/null +++ b/tests/neg-macros/i8865.scala @@ -0,0 +1,10 @@ +import scala.quoted._ +object Macro { + + def impl[A : Type](using Quotes): Expr[A] = { + import quotes.reflect._ + val tpe = TypeRepr.of[A].asType + '{ (a: ${tpe}) => ???} // error: tpe.Underlying cannot be used as a value type + '{???} + } +} \ No newline at end of file diff --git a/tests/pos-macros/i8865.scala b/tests/pos-macros/i8865.scala new file mode 100644 index 000000000000..ed4b5ae48033 --- /dev/null +++ b/tests/pos-macros/i8865.scala @@ -0,0 +1,10 @@ +import scala.quoted._ +object Macro { + + def impl[A : Type](using Quotes): Expr[A] = { + import quotes.reflect._ + TypeRepr.of[A].asType match + case '[tpe] => '{ (a: tpe) => ???} + '{???} + } +} \ No newline at end of file