Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

New Rule: no-implicit-type-coercion #625

Closed
adidahiya opened this issue Aug 31, 2015 · 4 comments
Closed

New Rule: no-implicit-type-coercion #625

adidahiya opened this issue Aug 31, 2015 · 4 comments

Comments

@adidahiya
Copy link
Contributor

I'd like to forbid null checks which use implicit type coercion:

if (nonBooleanValue) {
    ...
}

and instead enforce checks like this:

if (nonBooleanValue != null) {
    ...
}
@adidahiya
Copy link
Contributor Author

blocked on complete type information, which will be enabled by #680

@adidahiya
Copy link
Contributor Author

related: #253

@adidahiya adidahiya added P1 and removed P2 labels Nov 4, 2015
@adidahiya adidahiya changed the title New Rule: no-implicit-typecast New Rule: no-implicit-type-coercion Jul 8, 2016
@andy-hanson
Copy link
Contributor

strict-boolean-expressions should do this.

@OliverJAsh
Copy link
Contributor

strict-boolean-expressions does slightly more than just disallowing boolean coercion. I filed a suggestion for a new rule which only disallows boolean coercion: #4495.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants