Ensure that a generated AutoBuilder bridge method has appropriate generics.#2024
Closed
copybara-service[bot] wants to merge 0 commit intomainfrom
Closed
Ensure that a generated AutoBuilder bridge method has appropriate generics.#2024copybara-service[bot] wants to merge 0 commit intomainfrom
copybara-service[bot] wants to merge 0 commit intomainfrom
Conversation
d263faa to
c3bcc43
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.
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
uncheckedwarnings. 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
uncheckedcompilation warnings when generating a builder for a Kotlin class that has both type parameters and primary constructor parameters with default values.