Skip to content

Commit c8e593e

Browse files
committed
Fix quote pattern assign matching
1 parent c811957 commit c8e593e

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

library/src/scala/internal/quoted/Matcher.scala

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ import scala.quoted._
6767
* '{ while e0 do e1 } =?= '{ while p0 do p1 } ===> '{e0} =?= '{p0} &&& '{e1} =?= '{p1}
6868
*
6969
* /* Match assign */
70-
* '{ e0 = e1 } =?= '{ p0 = p1 } && '{e0} =?= '{p0} ===> '{e1} =?= '{p1}
70+
* '{ e0 = e1 } =?= '{ p0 = p1 } ==> '{e0} =?= '{p0} &&& '{e1} =?= '{p1}
7171
*
7272
* /* Match new */
7373
* '{ new T } =?= '{ new T } ===> matched
@@ -365,11 +365,7 @@ private[quoted] object Matcher {
365365

366366
/* Match assign */
367367
case (Assign(lhs1, rhs1), Assign(lhs2, rhs2)) =>
368-
val lhsMatch =
369-
if ((lhs1 =?= lhs2).isMatch) matched
370-
else notMatched
371-
// TODO lhs1 =?= lhs2 &&& rhs1 =?= rhs2
372-
lhsMatch &&& rhs1 =?= rhs2
368+
lhs1 =?= lhs2 &&& rhs1 =?= rhs2
373369

374370
/* Match new */
375371
case (New(tpt1), New(tpt2)) if tpt1.tpe.typeSymbol == tpt2.tpe.typeSymbol =>

0 commit comments

Comments
 (0)