Skip to content

Add reflect API: Select.apply with a symbol #6615

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

Merged
merged 1 commit into from
Jun 6, 2019

Conversation

liufengyun
Copy link
Contributor

Add reflect API: Select.apply with a symbol

Note: it's still good to keep Select.overloaded and generalize it to handle 0 and multiple param blocks. @OlivierBlanvillain has one use case for it AFAIK.

Copy link
Contributor

@nicolasstucki nicolasstucki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise LGTM

@@ -282,6 +282,9 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
if (self.symbol.signature == core.Signature.NotAMethod) None
else Some(self.symbol.signature)

def Select_apply(qualifier: Term, symbol: Symbol)(implicit ctx: Context): Select =
withDefaultPos(implicit ctx => tpd.Select(qualifier, Types.TermRef(qualifier.tpe, symbol)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This implicit function type will break the scala 2.12 build

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which is only tested after the merge

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have it in the code above?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then it fine

@nicolasstucki nicolasstucki merged commit fe749ea into scala:master Jun 6, 2019
@nicolasstucki nicolasstucki deleted the select-symbol branch June 6, 2019 09:21
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