Playing with new compiler
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Wed Jun 1 09:14:30 PDT 2011
Hi Ali,
the following looks problematic [the lambda expression is void
compatible, so it should not be possible to convert it to a SAM
descriptor returning String. The rest looks good to me (including the
message that says 'cyclic inference'). We are discussing as to whether,
in cases of cyclic inference, inference variables should be instantiated
eagerly or not (i.e. to Object) so that method applicability check can
continue. For now, the compiler is conservative, and does not attempt to
attribute a lambda body until the type of the lambda parameters are
fully known/inferred.
Maurizio
On 25/05/11 08:21, Ali Ebrahimi wrote:
> call(#{ x -> System.out.println(x);}); /* compile :
> reference to call is ambiguous, both method call(SAM1) in AMBTest and
> method call(SAM2) in AMBTest match
More information about the lambda-dev
mailing list