Skip to content

Allow macros to call method returning implicit functions #5299

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

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

@nicolasstucki
Copy link
Contributor Author

Extracted from #5297

@nicolasstucki
Copy link
Contributor Author

nicolasstucki commented Oct 19, 2018

I first tried to call the method and then call reflectively the apply method of the lambda. This did not work, the reflective call crashed saying that it cannot call a method marked as "public" 😂.

@nicolasstucki nicolasstucki force-pushed the fix-macro-with-implicit-fun-type branch from ab2a098 to b8aac4d Compare October 20, 2018 07:36
@liufengyun
Copy link
Contributor

CI is not happy.

@nicolasstucki nicolasstucki force-pushed the fix-macro-with-implicit-fun-type branch from b8aac4d to 659e7ee Compare October 22, 2018 06:56
@nicolasstucki
Copy link
Contributor Author

Fixed it

@@ -347,6 +347,8 @@ object Splicer {

object Call {
def unapply(arg: Tree): Option[(RefTree, List[Tree])] = arg match {
case Select(Call(fn, args), nme.apply) if defn.isImplicitFunctionType(fn.tpe.widenDealias.finalResultType) =>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was missing this guard.

@nicolasstucki
Copy link
Contributor Author

Fixed it

Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

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

LGTM

@nicolasstucki nicolasstucki merged commit f7b993a into scala:master Oct 23, 2018
@allanrenucci allanrenucci deleted the fix-macro-with-implicit-fun-type branch October 23, 2018 11:29
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