Skip to content

Add shrinker test for interface implementation being deserialized#2845

Merged
eamonnmcmanus merged 1 commit intogoogle:mainfrom
Marcono1234:marcono1234/shrinker-test-interface
Apr 16, 2025
Merged

Add shrinker test for interface implementation being deserialized#2845
eamonnmcmanus merged 1 commit intogoogle:mainfrom
Marcono1234:marcono1234/shrinker-test-interface

Conversation

@Marcono1234
Copy link
Copy Markdown
Contributor

Adds a shrinker test which tries to replicate the issue described in #2658.
@alipov, could you please check whether this test, specifically InterfaceWithImplementation and the usage in testDeserializingInterfaceImpl represents the setup you are using?

For R8 this currently fails, see TODOs in the new code. Not sure if there is something Gson can do at the moment, without making gson.pro unconditionally keep classes with @SerializedName regardless of whether they are used (which is probably something we want to avoid?). Also note that this might be an uncommon corner case.
Maybe this is actually an R8 bug or limitation.

For R8 this currently fails, see TODOs in the new code.
@alipov
Copy link
Copy Markdown

alipov commented Apr 16, 2025

@Marcono1234 Yep, that setup matches my usage.
Would you like me to open an R8 issue, perhaps @sgjesse might have an idea for a rule that handles this specific case?

@Marcono1234
Copy link
Copy Markdown
Contributor Author

Would you like me to open an R8 issue

Yes that would be great, thanks! Contact details are here: https://r8.googlesource.com/r8#getting-help (in case you didn't know that already).
Please link to the issue you created in your GitHub issue #2658 then so that others can follow it.

@Marcono1234
Copy link
Copy Markdown
Contributor Author

@eamonnmcmanus, do you think we can merge this here already to have a test case for it? (even if it currently has special handling for the R8 failure)

Copy link
Copy Markdown
Member

@eamonnmcmanus eamonnmcmanus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that makes sense. Thanks!

@eamonnmcmanus eamonnmcmanus merged commit 810e356 into google:main Apr 16, 2025
11 checks passed
@Marcono1234 Marcono1234 deleted the marcono1234/shrinker-test-interface branch April 16, 2025 22:27
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.

3 participants