Skip to content

Commit 8a3147a

Browse files
committed
Fix scala#8600: Match trough type asscriptions
1 parent 59f7e65 commit 8a3147a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ private[quoted] object Matcher {
181181
case (scrutinee, Typed(expr2, _)) =>
182182
scrutinee =?= expr2
183183

184+
case (Typed(expr1, _), pattern) =>
185+
expr1 =?= pattern
186+
184187
case (Ident(_), Ident(_)) if scrutinee.symbol == pattern.symbol || summon[Env].get(scrutinee.symbol).contains(pattern.symbol) =>
185188
matched
186189

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)