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

Undetected @Nullable annotation in super method #1129

Open
sdeleuze opened this issue Jan 13, 2025 · 0 comments
Open

Undetected @Nullable annotation in super method #1129

sdeleuze opened this issue Jan 13, 2025 · 0 comments

Comments

@sdeleuze
Copy link

With JSpecify mode enabled, I have this interface:

interface BodySpec<B, S extends BodySpec<B, S>> {
	<T extends S> T value(Consumer<@Nullable B> consumer);
}

Implemented in:

class DefaultBodySpec<B, S extends BodySpec<B, S>> implements BodySpec<B, S> {

	@Override
	public <T extends S> T value(Consumer<@Nullable B> consumer) {
		// ...
	}
}

Both are annotated with @Nullable but I get this error message:

error: [NullAway] Parameter has type Consumer<@org.jspecify.annotations.Nullable B>, but overridden method has parameter type Consumer<B>, which has mismatched type parameter nullability
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

No branches or pull requests

1 participant