You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make quote pattern type variable order deterministic (#17938)
This changes the order in which the type variables are listed in the
encoded quote pattern. The order of the variables is the same as the
order as they appear in the source.
Example:
```scala
import scala.quoted.*
def f(x: Expr[Any])(using Quotes) =
x match
case '{ type t; type u; Map[v, w]() } =>
```
```scala
[[syntax trees at end of typer]]
package <empty> {
import scala.quoted.*
final lazy module val Test$package: Test$package = new Test$package()
final module class Test$package() extends Object() {
this: Test$package.type =>
def f(x: scala.quoted.Expr[Any])(using x$2: scala.quoted.Quotes): Unit =
x match
{
case
x$2.asInstanceOf[scala.quoted.runtime.QuoteMatching].ExprMatch.
unapply[
scala.quoted.runtime.QuoteMatching.KCons[t @ _,
scala.quoted.runtime.QuoteMatching.KCons[u @ _,
scala.quoted.runtime.QuoteMatching.KCons[v @ _,
scala.quoted.runtime.QuoteMatching.KCons[w @ _,
scala.quoted.runtime.QuoteMatching.KNil]
]
]
],
(scala.quoted.Type[t], scala.quoted.Type[u],
scala.quoted.Type[v], scala.quoted.Type[w])
](
Tuple4.unapply[scala.quoted.Type[t], scala.quoted.Type[u],
scala.quoted.Type[v], scala.quoted.Type[w]](given t$given1 @ _,
given u$given1 @ _, given v$given1 @ _, given w$given1 @ _)
)(
'{
{
@patternType type t >: Nothing <: Any
@patternType type u >: Nothing <: Any
@patternType type v
@patternType type w
Map.apply[v, w]([ : (v, w)]*)
}
}.apply(x$2)
)
=>
()
}
}
}
```
We want all the places where `t`, `u`, `v` and `w` listed in some way to
be in that same order.
0 commit comments