Skip to content

Commit e31f142

Browse files
Merge pull request #8684 from dotty-staging/fix-#8600
Fix #8600: Match trough type ascription
2 parents 0391ebb + 7c927e4 commit e31f142

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
@@ -182,8 +182,8 @@ private[quoted] object Matcher {
182182
case (Literal(constant1), Literal(constant2)) if constant1 == constant2 =>
183183
matched
184184

185-
case (Typed(expr1, tpt1), Typed(expr2, tpt2)) =>
186-
expr1 =?= expr2 && tpt1 =?= tpt2
185+
case (Typed(expr1, _), pattern) =>
186+
expr1 =?= pattern
187187

188188
case (scrutinee, Typed(expr2, _)) =>
189189
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)