| Summary: | [1.8][null] Bogus error with @NonNullByDefault on generified inherited class | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Clovis Seragiotto <clovis.seragiotto> |
| Component: | Core | Assignee: | Stephan Herrmann <stephan.herrmann> |
| Status: | CLOSED MOVED | QA Contact: | |
| Severity: | major | ||
| Priority: | P2 | CC: | mike, stephan.herrmann |
| Version: | 4.8 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| See Also: | https://github.com/eclipse-jdt/eclipse.jdt.core/issues/682 | ||
| Whiteboard: | |||
Hit similar same problem, also illustrated in https://github.com/lastnpe/eclipse-null-eea-augments/pull/44/files ... > This produces no warning (even though <@NonNull A> is redundant): who cares... ;-) perhaps that problem could be a separate minor bug? > while this produces an error now that IMHO is real confusing (I just sank about 2h into getting my head around it), and perhaps more of a major problem? FYI what I found particularly confusing is that if one hovers over the (in your example) Bar<A> then it will show Bar<@NonNull A> so you like bang your head against the table "but so it IS @NonNull, so ... what?!" ;-) i can reproduce this. The type variables are copied before @NNBD is applied, so the copies don't have the @NonNull. This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. Still relevant . This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. Over to github: https://github.com/eclipse-jdt/eclipse.jdt.core/issues/682 |
This produces no warning (even though <@NonNull A> is redundant): @org.eclipse.jdt.annotation.NonNullByDefault({PARAMETER, RETURN_TYPE, FIELD, TYPE_PARAMETER, TYPE_BOUND, TYPE_ARGUMENT}) interface Foo<A> { interface Bar<@NonNull A> extends Iterable<Foo<A>> { } } while this produces an error (Null constraint mismatch: The type 'A' is not a valid substitute for the type parameter '@NonNull A') @org.eclipse.jdt.annotation.NonNullByDefault({PARAMETER, RETURN_TYPE, FIELD, TYPE_PARAMETER, TYPE_BOUND, TYPE_ARGUMENT}) interface Foo<A> { interface Bar<A> extends Iterable<Foo<A>> { } }