-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #3876: Implement Expr.AsFunction #3880
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
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.
Otherwise LGTM
val x1 = SyntheticValDef(NameKinds.UniqueName.fresh("x".toTermName), x) | ||
def x1Ref() = ref(x1.symbol) | ||
def rec(f: Tree): Tree = f match { | ||
case Block((ddef: DefDef) :: Nil, _: Closure) => |
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.
Use the closure
extractor instead (in TreeInfo).
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.
closure
only extracts the Closure
and here we also need its DefDef
. I will instead factor out a common extractor from closureBody
and this me method.
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.
Otherwise LGTM
@@ -534,9 +534,18 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] => | |||
} | |||
} | |||
|
|||
/** An extractor for closures with their def contained in a block. */ |
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.
I'd rename it to closureDef
and return just the def
. The closure part is used nowhere.
No description provided.