-
Notifications
You must be signed in to change notification settings - Fork 656
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
Use a constant for JvmOverloads to avoid a crash due to relocation #4008
Conversation
✅ Deploy Preview for apollo-android-docs canceled.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I think the JDK classes (like java.lang.Override
and java.lang.String
) are not relocated because they're not part of the fat jar so that'd explain why this has worked so far.
Doesn't hurt to not use them reflectively though 👍
CI fails with
|
Nothing's ever easy is it? 😅 I moved the test to a specific submodule instead - JVM only but also tried locally on a MP one which also didn't have the issue. |
How would that be an issue? Java codegen is not impacted and Kotlin should compile in all cases? |
That was kind of a wild guess, but in fact I just noticed it's |
I can repro
but to be honest I'm still bewildered |
@@ -177,12 +176,13 @@ class Options( | |||
val generateOptionalOperationVariables: Boolean = defaultGenerateOptionalOperationVariables, | |||
|
|||
/** | |||
* Whether to generate kotlin constructors with @JvmOverloads for more graceful Java interop experience when default values are present. | |||
* Whether to generate kotlin constructors with `@JvmOverloads` for more graceful Java interop experience when default values are present. | |||
* Note: when enabled in a multi-platform setup, the generated code can only be used in the common or JVM sourcesets. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
…4008) * Use a constant for JvmOverloads to avoid a crash due to relocation * Move test to own subproject * Add a note about `@JvmOverloads` being legal only in common or JVM targets
A fix for #4004.
There were also a few other instances or classes used directly, which didn't seem to cause trouble, but also fixed here for consistency.