File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed
compiler/src/scala/quoted/runtime/impl Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -301,7 +301,7 @@ object QuoteMatcher {
301301 /* Match new */
302302 case New (tpt1) =>
303303 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
305305 case _ => notMatched
306306
307307 /* 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