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

Dagger should not allow injection into Kotlin protected fields #4170

Closed
mwswartwout opened this issue Nov 30, 2023 · 1 comment
Closed

Dagger should not allow injection into Kotlin protected fields #4170

mwswartwout opened this issue Nov 30, 2023 · 1 comment

Comments

@mwswartwout
Copy link

Currently, Dagger can inject into Kotlin protected fields. I believe this is because the Kotlin protected field gets translated into a Java protected field, which escalates the visibility.

In Kotlin, internal should be the minimum visibility for injected fields. I discovered this while working on cl/578269246. Internal bug is b/314160777.

@erfansn
Copy link

erfansn commented Mar 18, 2024

I also

wanyingd1996 referenced this issue Mar 19, 2024
RELNOTES=Ban @Inject protected field.
PiperOrigin-RevId: 595746282
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants