typetools / typetools/checker-framework
type.argument warning when assigning to explicitly retyped type with wildcard parameters
Open
@smillst is already working on this.
Since Aug 23, 2025.
False Positive (false warning or imprecision)
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 440
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 134
Description
using checker 3.49.5
Following code
public class Test<T, L extends List<@Nullable T>> {
void method(Object x) {
Test<?, ?> y = (Test<?, ?>) x;
}
}
produces warning
java: [type.argument] incompatible type argument for type parameter L of Test.
found : capture#01[ extends @Initialized @NonNull List<capture#02[ extends @Initialized @Nullable Object super @Initialized @NonNull Void]> super @Initialized @NonNull Void]
required: @Initialized @NonNull List<capture#02[ extends @Initialized @Nullable Object super @Initialized @Nullable Void]>
I believe there is no reason for warning
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.