0.6a, section "Closure Conversion"
peter.levart at marand.si
Mon Dec 14 23:18:40 PST 2009
"A lambda expression may be converted to any compatible interface type by the lambda conversion, which is a kind of widening reference conversion.
There is a lambda conversion from a lambda expression to every interface type that has a single method m such that the lambda expression is compatible with m. A lambda expression is compatible with a method m iff all of the following hold:
The lambda expression is an expression lambda, and there is an assignment conversion from the type of its result expression to the return type of m; or
The lambda expression is a statement lambda, and either
its body cannot complete normally *and* there is an assignment conversion from the type of the expression in each of its return statements to the return type of m; or
all of its return statements yield no return value, and the method m has return type void or java.lang.Void
Shouldn't the bolded *and* really be *or* ?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the closures-dev