-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Move treeMatch
into QuoteMatcher
#17236
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
Move treeMatch
into QuoteMatcher
#17236
Conversation
treeMatch
into QuoteMatcher
(pat, Nil) | ||
|
||
val (pat1, typeHoles) = extractTypeHoles(pattern) | ||
def exprMatch(scrutinee: Tree, pattern: Tree)(using Context): Option[Tuple] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the advantage of splitting treeMatch like this? It seems we end up with quite a few lines duplicated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No sure anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I refactored the code to only keep treeMatch
as before. But added some optimizations to avoid using the TypeMap
when it is not going to do anything.
0acb329
to
c5e40ea
Compare
Now we do not use use the TypeMap if there is no type to map. We also do not create the type map if there are no expression that may contain types that need mapping.
c5e40ea
to
aad8475
Compare
Backports #17236 to the LTS branch. PR submitted by the release tooling.
No description provided.