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 @@ -354,7 +354,7 @@ object QuoteMatcher {
354
354
/* Match new */
355
355
case New (tpt1) =>
356
356
pattern match
357
- case New (tpt2) if tpt1.tpe.typeSymbol == tpt2.tpe.typeSymbol => matched
357
+ case New (tpt2) if tpt1.tpe.dealias. typeSymbol == tpt2.tpe.dealias .typeSymbol => matched
358
358
case _ => notMatched
359
359
360
360
/* 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