You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// If "@B class Y extends @A X {}", then enforce that @B must be a subtype of @A.
.
That is @Q class B extends A{} is valid and subtype check of qualifier is for @Q <: bound(A), while @Q class B extends @P A{} is not valid.
The text was updated successfully, but these errors were encountered:
wmdietl
changed the title
Forbid class annotation on extends and implements clause
Forbid annotations on class extends and implements clauses
Jan 11, 2025
What is valid or not will depend on the type system, but for most type systems the current rules are too lenient.
The Nullness Checker raises nullness.on.supertype for annotations in extends/super and we should generalize this as the default behavior.
A type system that needs annotations in that location should still be able to override checkExtendsAndImplements.
(The comment about the current behavior should be moved from BaseTypeVistitor to the javadoc of checkExtendsAndImplements and then adapted to the new behavior.)
We should issue error if there is annotation on
extends
andimplements
clauses instead of check the subtype like suggested in the commentchecker-framework/framework/src/main/java/org/checkerframework/common/basetype/BaseTypeVisitor.java
Line 831 in 064d327
That is
@Q class B extends A{}
is valid and subtype check of qualifier is for@Q <: bound(A)
, while@Q class B extends @P A{}
is not valid.The text was updated successfully, but these errors were encountered: