Skip to content
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

main-eisop: x(Foo<? super T>) cannot override identical signature #164

Closed
cpovirk opened this issue Feb 8, 2024 · 1 comment · Fixed by #171
Closed

main-eisop: x(Foo<? super T>) cannot override identical signature #164

cpovirk opened this issue Feb 8, 2024 · 1 comment · Fixed by #171
Assignees

Comments

@cpovirk
Copy link
Collaborator

cpovirk commented Feb 8, 2024

This is responsible for perhaps 90 errors in initial testing on Google's codebase, such as in AbstractHasher. That might make it the last significant source of errors in that testing. But of course I could be missing others among the noise, and we'll see whether new problems pop up as we fix the old :)

import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;

@NullMarked
interface SuperWildcardParent {
  <T extends @Nullable Object> void x(Foo<? super T> foo);
}

@NullMarked
interface SuperWildcardOverride extends SuperWildcardParent {
  @Override
  <T extends @Nullable Object> void x(Foo<? super T> foo);
}

@NullMarked
interface Foo<T extends @Nullable Object> {}
$ ../checker-framework/checker/bin/javac -processorpath $HOME/.m2/repository/org/jspecify/jspecify/0.3.0/jspecify-0.3.0.jar:build/libs/jspecify-reference-checker-0.0.0-SNAPSHOT.jar -processor com.google.jspecify.nullness.NullSpecChecker -AcheckImpl -AassumePure -AsuppressWarnings=contracts.conditional.postcondition.false.methodref,contracts.conditional.postcondition.false.override,contracts.conditional.postcondition.true.methodref,contracts.conditional.postcondition.true.override,purity.methodref,purity.overriding,type.anno.before.decl.anno,type.anno.before.modifier -cp $HOME/.m2/repository/org/jspecify/jspecify/0.3.0/jspecify-0.3.0.jar:build/libs/jspecify-reference-checker-0.0.0-SNAPSHOT.jar SuperWildcardOverride.java
SuperWildcardOverride.java:12: error: [override.param.invalid] Incompatible parameter type for foo.
  <T extends @Nullable Object> void x(Foo<? super T> foo);
                                                     ^
  found   : Foo<? super T>
  required: Foo<? super T>
  Consequence: method in SuperWildcardOverride
    void x(Foo<? super T>)
  cannot override method in SuperWildcardParent
    void x(Foo<? super T>)
1 error

This error doesn't jump out to me as obviously related to any of the issues under https://github.com/jspecify/checker-framework/issues, but I'm also not ruling it out.

@wmdietl
Copy link
Collaborator

wmdietl commented Apr 22, 2024

Fixed by #171.

@wmdietl wmdietl closed this as completed Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants