Skip to content

Commit 06a118e

Browse files
Merge pull request #8744 from dotty-staging/remove-unnecessary-matching-rules
Remove unnecessary quote matching rules
2 parents 3a5c390 + bdf9e01 commit 06a118e

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

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

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,6 @@ import scala.quoted._
9292
* /* Match type */
9393
* '[T] =?= '[P] && T <:< P ===> matched
9494
*
95-
* /* Match applied type */
96-
* '[ T0[T1, ..., Tn] ] =?= '[ P0[P1, ..., Pn] ] ===> '[T0] =?= '[P0] &&& ... &&& '[Tn] =?= '[Pn]
97-
*
98-
* /* Match annot (a) */
99-
* '[T @annot] =?= '[P] ===> '[T] =?= '[P]
100-
*
101-
* /* Match annot (b) */
102-
* '[T] =?= '[P @annot] ===> '[T] =?= '[P]
10395
* ```
10496
*/
10597
private[quoted] object Matcher {
@@ -350,11 +342,6 @@ private[quoted] object Matcher {
350342
case (scrutinee: TypeTree, pattern: TypeTree) if scrutinee.tpe <:< pattern.tpe =>
351343
matched
352344

353-
/* Match applied type */
354-
// TODO remove this?
355-
case (Applied(tycon1, args1), Applied(tycon2, args2)) =>
356-
tycon1 =?= tycon2 &&& args1 =?= args2
357-
358345
/* Match val */
359346
case (ValDef(_, tpt1, rhs1), ValDef(_, tpt2, rhs2)) if checkValFlags() =>
360347
def rhsEnv = summon[Env] + (scrutinee.symbol -> pattern.symbol)
@@ -378,15 +365,6 @@ private[quoted] object Matcher {
378365
// TODO match tpt1 with tpt2?
379366
matched
380367

381-
// Ignore type annotations
382-
// TODO remove this
383-
/* Match annot (a) */
384-
case (Annotated(tpt, _), _) =>
385-
tpt =?= pattern
386-
/* Match annot (b) */
387-
case (_, Annotated(tpt, _)) =>
388-
scrutinee =?= tpt
389-
390368
case (NamedArg(name1, arg1), NamedArg(name2, arg2)) if name1 == name2 =>
391369
arg1 =?= arg2
392370

0 commit comments

Comments
 (0)