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
nameSpan is incorrect for backquoted names with escaped characters #16234
Comments
The problem is that doing this would grow significantly the size of all trees, lowering performance, whereas the use case where this matters is very marginal. If we can come up with a scheme that does not increase the size of definition nodes, fine. Otherwise it should be a won't fix. |
That doesn't help |
Without having a "backticked" flag there's not much we can do then 🤔 I've thought about making the name start at |
Compiler version
3.2.1-RC2
Minimized code
Output
The span is wrong because Trees#nameSpan computes the span's end from
realName.length
, but since the characters were escaped the count is wrong.This is annoying for coverage reports, where
namePos
is used to "highlight" the method name in the coverage report.Expectation
The correct span should match the original source, thus it should be
[45..49]
(not sure whether the quotes should be included or not).The
Parser
produces anIdent
with the correct span (here, I think), could this be used instead?The text was updated successfully, but these errors were encountered: