File tree 3 files changed +23
-1
lines changed
compiler/src/scala/quoted/runtime/impl
3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -301,7 +301,7 @@ object QuoteMatcher {
301
301
/* Match new */
302
302
case New (tpt1) =>
303
303
pattern match
304
- case New (tpt2) if tpt1.tpe.typeSymbol == tpt2.tpe.typeSymbol => matched
304
+ case New (tpt2) if tpt1.tpe.dealias. typeSymbol == tpt2.tpe.dealias .typeSymbol => matched
305
305
case _ => notMatched
306
306
307
307
/* Match this */
Original file line number Diff line number Diff line change
1
+ package example
2
+
3
+ import scala .quoted .*
4
+
5
+ object A {
6
+ inline def f (inline a : Any ): Boolean = $ { impl(' a ) }
7
+
8
+ def impl (a : Expr [Any ])(using Quotes ): Expr [Boolean ] = {
9
+ a match {
10
+ case ' { new String ($x : Array [Byte ]) } => Expr (true )
11
+ case _ => quotes.reflect.report.errorAndAbort(" Expected match" , a)
12
+ }
13
+ }
14
+ }
Original file line number Diff line number Diff line change
1
+ package example
2
+
3
+ object Main {
4
+ def main (args : Array [String ]): Unit = {
5
+ val x = A .f(new String (Array .empty[Byte ]))
6
+ println(x)
7
+ }
8
+ }
You can’t perform that action at this time.
0 commit comments