Skip to content

Commit 7c927e4

Browse files
committed
Fix #8600: Match trough type ascriptions
1 parent 59f7e65 commit 7c927e4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ private[quoted] object Matcher {
175175
case (Literal(constant1), Literal(constant2)) if constant1 == constant2 =>
176176
matched
177177

178-
case (Typed(expr1, tpt1), Typed(expr2, tpt2)) =>
179-
expr1 =?= expr2 && tpt1 =?= tpt2
178+
case (Typed(expr1, _), pattern) =>
179+
expr1 =?= pattern
180180

181181
case (scrutinee, Typed(expr2, _)) =>
182182
scrutinee =?= expr2

tests/run-macros/quote-matcher-runtime.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Result: None
88

99
Scrutinee: (1: scala.Int)
1010
Pattern: 1
11-
Result: None
11+
Result: Some(List())
1212

1313
Scrutinee: (1: scala.Int)
1414
Pattern: (1: scala.Int)

0 commit comments

Comments
 (0)