Rethinking TypeAnnotation vs Annotation

Joel Borggrén-Franck joel.franck at oracle.com
Mon Feb 10 07:41:04 PST 2014


Hi,

On 06 Feb 2014, at 22:48, Werner Dietl <wdietl at gmail.com> wrote:

> Hi all,
> 
> an alternative would be to keep Compound only while it is unclear
> whether an annotation is a type or declaration annotation and
> introduce a new DeclarationCompound class that can be used when only
> declaration annotations are expected.
> Why not have the type system help us keep things straight?
> 

I’m not sure this will help us. After re-reading the spec I think a Compound (for lack of a better name) can be applicable to types, declarations, or both. That doesn’t seem like anything the type system will help us with today. Applicability to me seem more lika a “has-a” thing than “is-a”.  Instead we are doing manual code duplication (and I suspect duplication of bugs).

There might be a way the type system can help us further down, but I think that will be more clear after we do some refactoring and unification.

cheers
/Joel


More information about the compiler-dev mailing list