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

Matchers.isSubtypeOf always matches literal null #1397

Open
carterkozak opened this issue Nov 4, 2019 · 0 comments
Open

Matchers.isSubtypeOf always matches literal null #1397

carterkozak opened this issue Nov 4, 2019 · 0 comments

Comments

@carterkozak
Copy link
Contributor

ATTENTION! Please read and follow:

  • if this is a question about Error Prone, send it to [email protected]
  • if this is a bug or feature request, fill the form below as best as you can.

Description of the problem / feature request:

Matchers.isSubtypeOf always matches literal null. This would be correct if we were validating that the value can be cast to the requested type, however literal null should not match isSubtypeOf in most cases.
It's arguable that it could be matched for types Void and Object.

Feature requests: what underlying problem are you trying to solve with this feature?

Either return false for null in most cases, or provide javadoc describing the issue.

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

isSubtypeOf check on any null literal.

What version of Error Prone are you using?

2.3.3

Have you found anything relevant by searching the web?

No, I don't believe this has been reported yet.

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