-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #6048: set missing position in value class rewiring #6074
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
Conversation
@@ -92,7 +92,7 @@ class VCInlineMethods extends MiniPhase with IdentityDenotTransformer { | |||
tree // The rewiring will be handled by a fully-applied parent node | |||
case _ => | |||
if (isMethodWithExtension(tree.symbol)) | |||
rewire(tree).ensureConforms(tree.tpe) | |||
rewire(tree).ensureConforms(tree.tpe).withSpan(tree.span) |
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 would put the withSpan in the definition of rewire
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.
Thanks @smarter . That was what @nicolasstucki and I initially did -- but soon we find it's not the right place due to the recursive nature of rewire
.
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.
There is one branch of rewire
which is not recursive (the last one), that branch should get the withSpan.
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.
The problem is that we want to set the initial tree.span
, instead of the tree.span
from recursive calls.
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.
The issue there is that the tree
is the tree of the qualifier which does not have the position of the full call (it does not cover the arguments). We could pass the position as a parameter to rewire
instead.
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.
ah I see, one way to do that would be to change rewire to contain an inner method which is recursive, but I guess it's not very important since it's only used once anyway.
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.
Or we could pass the span
as an extra parameter.
Fix #6048: set missing position in value class rewiring (thanks @nicolasstucki )