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

False positive on NonBooleanPropertyPrefixedWithIs in 1.20.0-RC2 #4674

Closed
eygraber opened this issue Apr 4, 2022 · 5 comments
Closed

False positive on NonBooleanPropertyPrefixedWithIs in 1.20.0-RC2 #4674

eygraber opened this issue Apr 4, 2022 · 5 comments
Labels

Comments

@eygraber
Copy link
Contributor

eygraber commented Apr 4, 2022

inline val isDebuggable get() = BuildConfig.DEBUG

where BuildConfig.DEBUG is generated by AGP:

public final class BuildConfig {
  public static final boolean DEBUG = Boolean.parseBoolean("true");
}
@eygraber eygraber added the bug label Apr 4, 2022
@eygraber
Copy link
Contributor Author

eygraber commented Apr 4, 2022

It looks like this is also happening when reading a boolean property from an Android ViewBinding class.

@cortinico
Copy link
Member

Thanks for the issue report @eygraber 🙏 Is this a regression? Could you check with 1.19.x if the issue is happening?

Also are you using Type Resolution?

@kvn-stgl
Copy link
Contributor

kvn-stgl commented Apr 5, 2022

I retested this issue on detekt 1.19 and got the same error (just the BuildConfig errors are not reported).

I think that the main problem here is the issue #3488 (also for #4678). It seems like the generated sources are not included, so the type resolution is not working here.

@eygraber
Copy link
Contributor Author

eygraber commented Apr 5, 2022

Odd I wasn't able to repro on 1.19 (#4676 (comment)). Maybe there's something wrong with my setup that made type resolution not run correctly that got fixed in 1.20.

@BraisGabin
Copy link
Member

#4684 fixed this

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

No branches or pull requests

4 participants