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
Cf. this comment, it is not correct to inherit an implementation whose parameters are not covariant into a class where the same declaration would only be correct when it is taken into account that the parameters would be covariant-by-declaration implicitly. But it is allowed to inherit an implementation whose parameters are not covariant into a class where the same declaration would only be correct when it is taken into account that the parameters would be covariant-by-class.
This needs to be taken into account in the specification of what it means for a class to be fully implemented. We already have this:
It is a compile-time error if C has a concrete accessible member with the same name
as m, with a method signature m0 which is not a correct override
of m (11.2.2), unless that concrete member is a noSuchMethod forwarder (10.1.2).
We need to make sure that the inherited member, with declaration D, whose signature is m0, is not considered to have parameters that are covariant-by-declaration based on C, it must be computed based on the enclosing class of the declaration D.
The text was updated successfully, but these errors were encountered:
Cf. this comment, it is not correct to inherit an implementation whose parameters are not covariant into a class where the same declaration would only be correct when it is taken into account that the parameters would be covariant-by-declaration implicitly. But it is allowed to inherit an implementation whose parameters are not covariant into a class where the same declaration would only be correct when it is taken into account that the parameters would be covariant-by-class.
This needs to be taken into account in the specification of what it means for a class to be fully implemented. We already have this:
We need to make sure that the inherited member, with declaration D, whose signature is m0, is not considered to have parameters that are covariant-by-declaration based on
C
, it must be computed based on the enclosing class of the declaration D.The text was updated successfully, but these errors were encountered: