Skip to content
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

Extracting the left operand name of an infix expression using an unapply #307

Closed
wants to merge 2 commits into from
Closed

Conversation

hmemcpy
Copy link

@hmemcpy hmemcpy commented May 6, 2018

Fixes #303

This works around a renamed API between SDK versions.

This works around a renamed API between SDK versions
@hmemcpy
Copy link
Author

hmemcpy commented May 6, 2018

I ended up extracting a helper function instead of going the sdkcompat route. If there is a better suggestion, I'd love to hear it!

@chaoren
Copy link
Collaborator

chaoren commented May 6, 2018

Would get first child work?

@hmemcpy
Copy link
Author

hmemcpy commented May 6, 2018

Hmm, I haven't checked, to be honest.
I used the lOp() API from your suggestion, back when I implemented specs2 support.
If I recall correctly, my original implementation had looking up a child REFERENCE_EXPRESSION... see that commit here

Perhaps I cold just really look up the first child and it would work. Certainly would be cleaner than calling Scala-specific constructs from Java.

@hmemcpy
Copy link
Author

hmemcpy commented May 7, 2018

After taking an additional look, seems that firstChild would work here, as it gives me the Literal element.

@chaoren
Copy link
Collaborator

chaoren commented May 7, 2018

Merged. Thanks.

@chaoren chaoren closed this May 7, 2018
@hmemcpy hmemcpy deleted the specs2-fix branch May 22, 2018 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants