Skip to content

Comments

Ensure that a generated AutoBuilder bridge method has appropriate generics.#2024

Closed
copybara-service[bot] wants to merge 0 commit intomainfrom
test_869398163
Closed

Ensure that a generated AutoBuilder bridge method has appropriate generics.#2024
copybara-service[bot] wants to merge 0 commit intomainfrom
test_869398163

Conversation

@copybara-service
Copy link
Contributor

Ensure that a generated AutoBuilder bridge method has appropriate generics.

When a Kotlin data class has at least one primary constructor parameter with a default value, AutoBuilder synthesizes a class with a bridge method that can be used to call that constructor. (It needs to do this because the constructor it wants to call is marked synthetic, meaning that it can't be called from Java source code.) Previously, even if the Kotlin data class had type parameters, this synthesized method did not, which led to unchecked warnings. That caused a problem when compiling with -Werror.

(A simpler fix would have been just to add @SuppressWarnings("unchecked") at the call site, but I was concerned that that might mask other problems.)

RELNOTES=AutoBuilder now no longer causes unchecked compilation warnings when generating a builder for a Kotlin class that has both type parameters and primary constructor parameters with default values.

@copybara-service copybara-service bot closed this Feb 13, 2026
@copybara-service copybara-service bot deleted the test_869398163 branch February 13, 2026 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants