-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #10868: Handle semantic name in Java source code #11472
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
14f09b9
to
b37f184
Compare
b37f184
to
14395cf
Compare
if !qual.symbol.is(JavaDefined) && tree.name.endsWith("$") | ||
then | ||
val nameOrig = tree.name.asSimpleName | ||
val nameSemantic = nameOrig.slice(0, nameOrig.length - 1).moduleClassName | ||
val tree2 = untpd.cpy.Select(tree)(qual, nameSemantic) |
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.
unmangleClassName in NameOps already has similar logic
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 for the tip 👍
if !qual.symbol.is(JavaDefined) | ||
then |
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.
we usually put the then
on the same line as the if
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.
Indeed, that looks better
98dac6b
to
37ab3b3
Compare
Fix #10868: Handle semantic name in Java source code