Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotations on class declaration extends #10

Open
smillst opened this issue Nov 16, 2015 · 1 comment
Open

Annotations on class declaration extends #10

smillst opened this issue Nov 16, 2015 · 1 comment

Comments

@smillst
Copy link
Member

smillst commented Nov 16, 2015

We currently don't support annotations on implicit extends for class declarations see comment on:
VariableAnnotator#createImpliedExtendsLocation(com.sun.source.tree.ClassTree)
And according to the email exchange below, we should not.

@smillst
Copy link
Member Author

smillst commented Nov 16, 2015

This is the portion of the email exchange that is relevant to this issue. (The rest of the email is reported in #11)


From: Jonathan Burke

How do these annotations relate to annotations on an extends bound?

@Anno1 class MyClass extends @Anno2 BaseClass {}

Thanks,
Jonathan


From: Michael Ernst

Jonathan-

The other question to go along with this is, how do these annotations relate to annotations on an extends bound?

@ANNO1 class MyClass extends @ANNO2 BaseClass {}

I would think that the annotations (explicit/implicit/defaulted) would need to satisfy the relationship >@ANNO1 <: @ANNO2.

-Mike


From: Werner Dietl

Jonathan, all,

what is the meaning of an annotation on a superclass or superinterface
at all? They are not "extends bounds" - they don't restrict instantiations.

In

@Anno1 class MyClass extends @Anno2 BaseClass
  implements @Anno3 BaseItf {
}

When do we use @ANNO2 and @Anno3?

I think at the moment these two annotations are not used at all and
adding the checks

@ANNO1 <: @ANNO2
@ANNO1 <: @Anno3

seems not very useful.

I think @ANNO1, the annotation on the class declaration, should also be
used for the type of "this" in the class body - for the locations where
no method receiver can be specified - e.g. for fields and instance
initializer blocks.

@ANNO2 and @Anno3 might be useful for well-formedness checking of the
superclass/superinterface type. However, do we have examples where
@ANNO1 should not be used for this?

cu, WMD.

wmdietl added a commit that referenced this issue Jul 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant