-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
assignment.type.incompatible only with explicit "extends @Nullable Object" on type parameter #2995
Comments
This turns out to affect implementations of the JDK's
(similarly in typetools/jdk)
|
Yes, this is a bug; your test case should not issue any warnings. This may be related to #2926.
I think that would be helpful. Thanks! |
It is supposed to be a no-op. As such, the stub files usually omit it. Currently, it actually changes behavior in a bad way: typetools#2995 Until that bug is fixed, this commit serves as a workaround.
It is supposed to be a no-op. As such, the stub files usually omit it. Currently, it actually changes behavior in a bad way: typetools/checker-framework#2995 Until that bug is fixed, this commit serves as a workaround.
It is supposed to be a no-op. As such, the stub files usually omit it. Currently, it actually changes behavior in a bad way: #2995 Until that bug is fixed, this commit serves as a workaround.
It is supposed to be a no-op. As such, the stub files usually omit it. Currently, it actually changes behavior in a bad way: typetools/checker-framework#2995 Until that bug is fixed, this commit serves as a workaround.
This passes the Checker Framework only with significant preparations: - I use custom stub files. - I pass a particular set of flags to the Checker Framework. - I add `@SuppressWarnings` on `toArray` methods. - I replace | and & with || and &&. - I remove `extends @nullable Object`, as it currently can cause problems: typetools/checker-framework#2995 Another branch will address some of these issues but not all.
I could be confused, but: I would expect
class Map<K>
andclass Map<K extends @Nullable Object>
to be equivalent. It appears that they're not. Here's some code that uses the longer version:However, if I tweak the class declaration to the "equivalent" shorter version, then the file compiles successfully. That's the behavior I would have expected in either case.
If I suppress the error, the
.class
files that I get for the long version is almost identical to that for the short version, according tojavap -v
. The only difference appears to be in the order of theRuntimeVisibleTypeAnnotations
.Source file and
-version -verbose -AprintAllQualifiers
output attached.The text was updated successfully, but these errors were encountered: