Skip to content

Remove unnecessary quote matching rules #8744

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions library/src/scala/internal/quoted/Matcher.scala
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,6 @@ import scala.quoted._
* /* Match type */
* '[T] =?= '[P] && T <:< P ===> matched
*
* /* Match applied type */
* '[ T0[T1, ..., Tn] ] =?= '[ P0[P1, ..., Pn] ] ===> '[T0] =?= '[P0] &&& ... &&& '[Tn] =?= '[Pn]
*
* /* Match annot (a) */
* '[T @annot] =?= '[P] ===> '[T] =?= '[P]
*
* /* Match annot (b) */
* '[T] =?= '[P @annot] ===> '[T] =?= '[P]
* ```
*/
private[quoted] object Matcher {
Expand Down Expand Up @@ -350,11 +342,6 @@ private[quoted] object Matcher {
case (scrutinee: TypeTree, pattern: TypeTree) if scrutinee.tpe <:< pattern.tpe =>
matched

/* Match applied type */
// TODO remove this?
case (Applied(tycon1, args1), Applied(tycon2, args2)) =>
tycon1 =?= tycon2 &&& args1 =?= args2

/* Match val */
case (ValDef(_, tpt1, rhs1), ValDef(_, tpt2, rhs2)) if checkValFlags() =>
def rhsEnv = summon[Env] + (scrutinee.symbol -> pattern.symbol)
Expand All @@ -378,15 +365,6 @@ private[quoted] object Matcher {
// TODO match tpt1 with tpt2?
matched

// Ignore type annotations
// TODO remove this
/* Match annot (a) */
case (Annotated(tpt, _), _) =>
tpt =?= pattern
/* Match annot (b) */
case (_, Annotated(tpt, _)) =>
scrutinee =?= tpt

case (NamedArg(name1, arg1), NamedArg(name2, arg2)) if name1 == name2 =>
arg1 =?= arg2

Expand Down