Skip to content

Commit d3f50c2

Browse files
committed
Fix #8865: Add regression test
1 parent 8631782 commit d3f50c2

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

tests/neg-macros/i8865.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import scala.quoted._
2+
object Macro {
3+
4+
def impl[A : Type](using Quotes): Expr[A] = {
5+
import quotes.reflect._
6+
val tpe = TypeRepr.of[A].asType
7+
'{ (a: ${tpe}) => ???} // error: tpe.Underlying cannot be used as a value type
8+
'{???}
9+
}
10+
}

tests/pos-macros/i8865.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import scala.quoted._
2+
object Macro {
3+
4+
def impl[A : Type](using Quotes): Expr[A] = {
5+
import quotes.reflect._
6+
TypeRepr.of[A].asType match
7+
case '[tpe] => '{ (a: tpe) => ???}
8+
'{???}
9+
}
10+
}

0 commit comments

Comments
 (0)