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
{{ message }}
Repository navigation
Sample input: Inheriting the same type with different arguments #68
IntegerList is inheriting List twice with "different arguments," @Nullable Integer and @NotNull Integer. That is, it's both a List<@Nullable Integer> and a List<@NotNull Integer>. That's no good. This should be illegal, just as it's illegal to be both a List<Integer> and a List<Double> (8.1.5):
Over the past year, I've come to believe that it's not our job to write rules like this. Instead, we write rules for subtyping and substitution (and maybe others that I'm forgetting), and it's up to tools how to apply those. I would expect for tools to often decide to apply subtyping checks in the same cases as the JLS requires for normal subtyping. A tool that was strict about this would issue an error in this case. But actually writing such a rule isn't our goal for this project.
Rather than close this issue outright, I'm going to retitle it to suggest that we add a sample input, as tool owners may find it useful as a case to consider.
changed the title [-]Rules for inheriting the same type with different arguments[/-][+]Sample input: Inheriting the same type with different arguments[/+]on Sep 24, 2020
Activity
cpovirk commentedon Aug 16, 2019
The Checker Framework currently permits this, but they consider it a bug: typetools/checker-framework#679
cpovirk commentedon Sep 24, 2020
Over the past year, I've come to believe that it's not our job to write rules like this. Instead, we write rules for subtyping and substitution (and maybe others that I'm forgetting), and it's up to tools how to apply those. I would expect for tools to often decide to apply subtyping checks in the same cases as the JLS requires for normal subtyping. A tool that was strict about this would issue an error in this case. But actually writing such a rule isn't our goal for this project.
Rather than close this issue outright, I'm going to retitle it to suggest that we add a sample input, as tool owners may find it useful as a case to consider.
(And I'm doing the same thing in #67.)
[-]Rules for inheriting the same type with different arguments[/-][+]Sample input: Inheriting the same type with different arguments[/+]