diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaSymbolProvider.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaSymbolProvider.kt index 012242ef464..3e6a7d9b28c 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaSymbolProvider.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaSymbolProvider.kt @@ -146,7 +146,9 @@ class JavaSymbolProvider( .map { it.toFirTypeParameter(stack) } .also { it.forEachIndexed { index, typeParameter -> - typeParameter.addBounds(this[index], stack) + if (typeParameter.bounds.isEmpty()) { + typeParameter.addBounds(this[index], stack) + } } } } diff --git a/compiler/testData/loadJava/compiledJava/ClassWithTypePP.fir.txt b/compiler/testData/loadJava/compiledJava/ClassWithTypePP.fir.txt index 53be87bc02c..ae67ea3b7ef 100644 --- a/compiler/testData/loadJava/compiledJava/ClassWithTypePP.fir.txt +++ b/compiler/testData/loadJava/compiledJava/ClassWithTypePP.fir.txt @@ -1,4 +1,4 @@ -public final class ClassWithTypePP
: R|kotlin/Any| { - public constructor
(): R|test/ClassWithTypePP
| +public final class ClassWithTypePP
: R|kotlin/Any| { + public constructor
(): R|test/ClassWithTypePP
|
}
diff --git a/compiler/testData/loadJava/compiledJava/ClassWithTypePRefNext.fir.txt b/compiler/testData/loadJava/compiledJava/ClassWithTypePRefNext.fir.txt
index 95e6d10b368..e36bdb46e5a 100644
--- a/compiler/testData/loadJava/compiledJava/ClassWithTypePRefNext.fir.txt
+++ b/compiler/testData/loadJava/compiledJava/ClassWithTypePRefNext.fir.txt
@@ -1,4 +1,4 @@
-public open class ClassWithTypePRefNext |, P> : R|kotlin/Any| {
- public constructor |, P>(): R|test/ClassWithTypePRefNext |, R|kotlin/Enum |> : R|kotlin/Any| {
- public constructor |, R|kotlin/Enum |>(): R|test/ClassWithTypePRefSelf |
+public final class ClassWithTypePRefSelf |> : R|kotlin/Any| {
+ public constructor |>(): R|test/ClassWithTypePRefSelf |
}
diff --git a/compiler/testData/loadJava/compiledJava/ClassWithTypePRefSelfAndClass.fir.txt b/compiler/testData/loadJava/compiledJava/ClassWithTypePRefSelfAndClass.fir.txt
index 1d762fca539..46cb7f3a7d5 100644
--- a/compiler/testData/loadJava/compiledJava/ClassWithTypePRefSelfAndClass.fir.txt
+++ b/compiler/testData/loadJava/compiledJava/ClassWithTypePRefSelfAndClass.fir.txt
@@ -1,4 +1,4 @@
-public final class ClassWithTypePRefSelfAndClass |, R|test/ClassWithTypePRefSelfAndClass |> : R|kotlin/Any| {
- public constructor |, R|test/ClassWithTypePRefSelfAndClass |>(): R|test/ClassWithTypePRefSelfAndClass |
+public final class ClassWithTypePRefSelfAndClass |> : R|kotlin/Any| {
+ public constructor |>(): R|test/ClassWithTypePRefSelfAndClass |
}