We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
@UnknownInitialization
Consider the following test case:
import org.checkerframework.framework.qual.AnnotatedFor; @AnnotatedFor("nullness") public class Issue3449 { int length; public Issue3449(Object... args) { length = args.length; } }
Compiling it with
javac -g Issue3449.java -processor nullness -AuseConservativeDefaultsForUncheckedCode=source
yields this error:
Issue3449.java:9: error: [assignment.type.incompatible] incompatible types in assignment. length = args.length; ^ found : @UnknownInitialization @NonNull int required: @Initialized @NonNull int 1 error
The file type-checks if I remove @AnnotatedFor or the -AuseConservativeDefaultsForUncheckedCode=source command-line option.
@AnnotatedFor
-AuseConservativeDefaultsForUncheckedCode=source
The text was updated successfully, but these errors were encountered:
Test case for issue #3449
d3da57a
It's not the formal parameter that's @UnknownInitialization; it's the field access of length. I've got a fix in #3459.
Sorry, something went wrong.
Default array.length to @initialized. (#3459)
9d44208
Fixes #3449.
Successfully merging a pull request may close this issue.
Consider the following test case:
Compiling it with
yields this error:
The file type-checks if I remove
@AnnotatedFor
or the-AuseConservativeDefaultsForUncheckedCode=source
command-line option.The text was updated successfully, but these errors were encountered: