FIR Java: don't add type parameter bounds multiple times

This commit is contained in:
Mikhail Glukhikh
2019-11-11 14:05:58 +03:00
parent a18da68171
commit db11c14fee
5 changed files with 11 additions and 9 deletions
@@ -146,7 +146,9 @@ class JavaSymbolProvider(
.map { it.toFirTypeParameter(stack) } .map { it.toFirTypeParameter(stack) }
.also { .also {
it.forEachIndexed { index, typeParameter -> it.forEachIndexed { index, typeParameter ->
typeParameter.addBounds(this[index], stack) if (typeParameter.bounds.isEmpty()) {
typeParameter.addBounds(this[index], stack)
}
} }
} }
} }
@@ -1,4 +1,4 @@
public final class ClassWithTypePP<P, Q : R|P|, R|P|> : R|kotlin/Any| { public final class ClassWithTypePP<P, Q : R|P|> : R|kotlin/Any| {
public constructor<P, Q : R|P|, R|P|>(): R|test/ClassWithTypePP<P, Q>| public constructor<P, Q : R|P|>(): R|test/ClassWithTypePP<P, Q>|
} }
@@ -1,4 +1,4 @@
public open class ClassWithTypePRefNext<R : R|kotlin/collections/MutableIterable<P>|, R|kotlin/collections/MutableIterable<P>|, P> : R|kotlin/Any| { public open class ClassWithTypePRefNext<R : R|kotlin/collections/MutableIterable<P>|, P> : R|kotlin/Any| {
public constructor<R : R|kotlin/collections/MutableIterable<P>|, R|kotlin/collections/MutableIterable<P>|, P>(): R|test/ClassWithTypePRefNext<R, P>| public constructor<R : R|kotlin/collections/MutableIterable<P>|, P>(): R|test/ClassWithTypePRefNext<R, P>|
} }
@@ -1,4 +1,4 @@
public final class ClassWithTypePRefSelf<P : R|kotlin/Enum<P>|, R|kotlin/Enum<P>|> : R|kotlin/Any| { public final class ClassWithTypePRefSelf<P : R|kotlin/Enum<P>|> : R|kotlin/Any| {
public constructor<P : R|kotlin/Enum<P>|, R|kotlin/Enum<P>|>(): R|test/ClassWithTypePRefSelf<P>| public constructor<P : R|kotlin/Enum<P>|>(): R|test/ClassWithTypePRefSelf<P>|
} }
@@ -1,4 +1,4 @@
public final class ClassWithTypePRefSelfAndClass<P : R|test/ClassWithTypePRefSelfAndClass<P>|, R|test/ClassWithTypePRefSelfAndClass<P>|> : R|kotlin/Any| { public final class ClassWithTypePRefSelfAndClass<P : R|test/ClassWithTypePRefSelfAndClass<P>|> : R|kotlin/Any| {
public constructor<P : R|test/ClassWithTypePRefSelfAndClass<P>|, R|test/ClassWithTypePRefSelfAndClass<P>|>(): R|test/ClassWithTypePRefSelfAndClass<P>| public constructor<P : R|test/ClassWithTypePRefSelfAndClass<P>|>(): R|test/ClassWithTypePRefSelfAndClass<P>|
} }