interactions between type annotations and language model APIs.

Werner Dietl wdietl at gmail.com
Thu May 8 22:10:14 UTC 2014


In this message:

http://mail.openjdk.java.net/pipermail/compiler-dev/2014-May/008758.html

Alex raises the issue of "generator" methods and how  "the "correct"
thing to do would be to inspect the TypeMirror argument and thread its
type annotations into the TypeMirror result."

I agree that better support for type annotations in these methods
would be great.
It would also be awesome if subtyping, type inference, and other type
operations were aware of type annotations.

In the Checker Framework we need to go to great effort to re-calculate
some computations that the compiler already performed, just to add the
right type annotations. This is error prone and we might produce
incorrect results.

However, one complication is that to correctly "thread" type
annotations through such computations, it is not enough to take the
annotations from one side or the other or to append the lists of type
annotations. For uses in type systems, you want to perform an
operation like building the least upper bound or greatest lower bound
of the two sets of type annotations.
These operations depend on the particular interpretation of type
annotations and I don't see how the compiler could independently
perform the right operation.

It would be awesome if there were a way for outside tool-builders to
adapt the behavior of the compiler in such situations.
Is this something you are considering when planning these changes?

Cheers,
cu, WMD.

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


More information about the type-annotations-dev mailing list