We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 160d4dd commit ce31908Copy full SHA for ce31908
compiler/src/dotty/tools/dotc/ast/tpd.scala
@@ -104,6 +104,12 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
104
Closure(Nil, call, targetTpt))
105
}
106
107
+ /** A closure whole anonymous function has the given method type */
108
+ def Lambda(tpe: MethodType, rhsFn: List[Tree] => Tree)(implicit ctx: Context): Block = {
109
+ val meth = ctx.newSymbol(ctx.owner, nme.ANON_FUN, Synthetic | Method, tpe)
110
+ Closure(meth, tss => rhsFn(tss.head).changeOwner(ctx.owner, meth))
111
+ }
112
+
113
def CaseDef(pat: Tree, guard: Tree, body: Tree)(implicit ctx: Context): CaseDef =
114
ta.assignType(untpd.CaseDef(pat, guard, body), body)
115
0 commit comments