[KT-84822] Add javac parameters flag to get same ir in jklib tests#5891
Open
[KT-84822] Add javac parameters flag to get same ir in jklib tests#5891
parameters flag to get same ir in jklib tests#5891Conversation
…endencies matches jvm IR tests
…rom dependencies matches jvm IR tests unmuted tests that now pass
Code Owners
|
parameters flag to get same ir in jklib tests
jDramaix
reviewed
Apr 20, 2026
…rom dependencies matches jvm IR tests Added comment to clarify parameter
jDramaix
approved these changes
Apr 20, 2026
zardilior
commented
Apr 23, 2026
| @@ -64,7 +64,8 @@ class JKlibJavaSourceConfigurator(testServices: TestServices) : EnvironmentConfi | |||
| "${module.name}-java-binaries", | |||
| extraClasspath = jvmClasspathRoots, | |||
| assertions = testServices.assertions, | |||
Collaborator
Author
There was a problem hiding this comment.
The only change besides test related unmuting and updates are this file and compiler/tests-compiler-utils/testFixtures/org/jetbrains/kotlin/test/MockLibraryUtil.kt at the bottom
zardilior
commented
Apr 28, 2026
| @@ -28,9 +28,9 @@ FILE fqName:<root> fileName:/Kotlin1.kt | |||
| public open fun hashCode (): kotlin.Int declared in <root>.BaseJava | |||
Collaborator
Author
There was a problem hiding this comment.
This is an example of how the change affects IR generation when inheriting from java sources
demiurg906
reviewed
Apr 29, 2026
| } | ||
| add("-encoding") | ||
| add("utf8") | ||
| addAll(extraOptions) |
Contributor
There was a problem hiding this comment.
You cannot use the same extraOptions list for javac and kotlinc at the same time.
Please introduce a new extraJavacOptions and use it instead.
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.
Problem
Some JKlib tests were failing due to IR data mismatches when depending on Java sources By default, the Java compiler was stripping parameter names, causing discrepancies in the IR produced by the Kotlin compiler.
Solution
Add the
-parametersflag to the Java compilation of these sources to preserve parameter names in the class files. This allows the Kotlin compiler to read the names from the JARs and produce the expected IR.Unrelated change
Making javaBackedTest previously added for jklib testing a jvm test, now it passes with both