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

VarCouldBeVal on @Inject lateinit var #4662

Closed
meriouma opened this issue Apr 1, 2022 · 4 comments
Closed

VarCouldBeVal on @Inject lateinit var #4662

meriouma opened this issue Apr 1, 2022 · 4 comments
Labels

Comments

@meriouma
Copy link
Contributor

meriouma commented Apr 1, 2022

Expected Behavior

Not getting VarCouldBeVal

Observed Behavior

Getting VarCouldBeVal

Context

@MicronautTest
class SomeTest {
    @Inject // <-- VarCouldBeVal targetting this line
    private lateinit var objectMapper: ObjectMapper
}

Your Environment

  • Version of detekt used: 1.20.0-RC2
  • Version of Gradle used (if applicable): 7.4.1
@meriouma meriouma added the bug label Apr 1, 2022
@cortinico
Copy link
Member

Is this a regression from 1.19.0?

@meriouma
Copy link
Contributor Author

meriouma commented Apr 1, 2022

Seems to be. Just tested with 1.19.0 and the error is not reported.

@meriouma
Copy link
Contributor Author

meriouma commented Apr 1, 2022

I believe this is related to this PR adding more validations : #4424

@BraisGabin
Copy link
Member

This is working as expected. You should use ignoreAnnotated: ['Inject'] to ignore those.

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

3 participants