Type Annotations and Lambda

Werner Dietl wdietl at gmail.com
Tue Feb 5 14:19:41 PST 2013


Dear all,

I implemented method and constructor reference type arguments
(METHOD_REFERENCE_TYPE_ARGUMENT and
CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT) in this changeset:

http://hg.openjdk.java.net/type-annotations/type-annotations/langtools/rev/257b779bc4c7

This resolves the crash noticed by Steve and implements correct
bytecode storage.
More extensive tests would be great. I no longer manage to crash the
compiler with any type annotation uses in lambda.

I am waiting on a specification clarification from Mike and/or Alex
about METHOD_REFERENCE_RECEIVER and CONSTRUCTOR_REFERENCE_RECEIVER.
To me these don't look like type uses, but instead only like scoping
mechanisms, for which we don't support type annotations.
It would be great to see a few examples of type uses for these and
what the interpretation of type annotations should be.

Finally, the spec says that type annotations in the signature or body
of a lambda expression should appear in the method that results from
translation.
I was hoping that this would work without any special effort. However,
no type annotations appear in a translated method.
Could somebody point me to the location in the code that translates a
lambda expression into a method?

Thanks,
cu, WMD.

-- 
http://www.google.com/profiles/wdietl


More information about the type-annotations-dev mailing list