Support @BindValue in Kotlin companion objects. - #5232
Open
copybara-service[bot] wants to merge 1 commit into
Open
Support @BindValue in Kotlin companion objects.#5232copybara-service[bot] wants to merge 1 commit into
copybara-service[bot] wants to merge 1 commit into
Conversation
copybara-service
Bot
force-pushed
the
test_952218422
branch
2 times, most recently
from
July 28, 2026 19:07
87ce9d8 to
0467243
Compare
This change updates the Hilt to support @bindvalue within companion objects in Kotlin to match the behavior in Java where we allow @bindvalue on static fields. Technically, we already support this in KAPT when `@JvmField` is used, since the Java stub will treat that as a static field in the test class. However, this CL allows companion object properties without `@JvmField`. This CL also fixes a bug where we didn't properly handle properties in companion objects when processing with KSP both with and without `@JvmField` (b/493642906). RELNOTES=N/A PiperOrigin-RevId: 952218422
copybara-service
Bot
force-pushed
the
test_952218422
branch
from
July 29, 2026 02:43
0467243 to
6caf840
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Support @bindvalue in Kotlin companion objects.
This change updates the Hilt to support @bindvalue within companion objects in Kotlin to match the behavior in Java where we allow @bindvalue on static fields.
Technically, we already support this in KAPT when
@JvmFieldis used, since the Java stub will treat that as a static field in the test class. However, this CL allows companion object properties without@JvmField.This CL also fixes a bug where we didn't properly handle properties in companion objects when processing with KSP both with and without
@JvmField(b/493642906).RELNOTES=N/A