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
Replace quoted type variables in signature of HOAS pattern result
To be able to construct the lambda returned by the HOAS pattern we need:
first resolve the type variables and then use the result to construct the
signature of the lambdas.
To simplify this transformation, `QuoteMatcher` returns a `Seq[MatchResult]`
instead of an untyped `Tuple` containing `Expr[?]`. The tuple is created
once we have accumulated and processed all extracted values.
Fixes#15165
Copy file name to clipboardExpand all lines: compiler/src/scala/quoted/runtime/impl/QuoteMatcher.scala
+60-27Lines changed: 60 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -109,7 +109,7 @@ object QuoteMatcher {
109
109
/** Sequence of matched expressions.
110
110
* These expressions are part of the scrutinee and will be bound to the quote pattern term splices.
111
111
*/
112
-
typeMatchingExprs=Seq[Expr[Any]]
112
+
typeMatchingExprs=Seq[MatchResult]
113
113
114
114
/** A map relating equivalent symbols from the scrutinee and the pattern
115
115
* For example in
@@ -141,12 +141,13 @@ object QuoteMatcher {
141
141
extension (scrutinee0: Tree)
142
142
143
143
/** Check that the trees match and return the contents from the pattern holes.
144
-
* Return None if the trees do not match otherwise return Some of a tuple containing all the contents in the holes.
144
+
* Return a sequence containing all the contents in the holes.
145
+
* If it does not match, continues to the `optional` with `None`.
145
146
*
146
147
* @paramscrutinee The tree being matched
147
148
* @parampattern The pattern tree that the scrutinee should match. Contains `patternHole` holes.
148
149
* @param`summon[Env]` Set of tuples containing pairs of symbols (s, p) where s defines a symbol in `scrutinee` which corresponds to symbol p in `pattern`.
149
-
* @return`None` if it did not match or `Some(tup: MatchingExprs)` if it matched where `tup` contains the contents of the holes.
150
+
* @returnThe sequence with the contents of the holes of the matched expression.
0 commit comments