FIR Java: fix creation & handling of type parameter symbols
Before this commit, we created type parameter symbols each time when type parameter was referenced or created. In this commit, we introduced class-bound Java type parameter stack and use it to find referenced type parameter symbol. So now they are created only when Java type parameter is created
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
public final class ClassWithTypePP<P, Q> : R|java/lang/Object| {
|
||||
public final class ClassWithTypePP<P, Q : R|P|> : R|java/lang/Object| {
|
||||
}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
public open class ClassWithTypePRefNext<R, P> : R|java/lang/Object| {
|
||||
public open class ClassWithTypePRefNext<R : R|java/lang/Iterable<P>|, P> : R|java/lang/Object| {
|
||||
}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
public final class ClassWithTypePRefSelf<P> : R|java/lang/Object| {
|
||||
public final class ClassWithTypePRefSelf<P : R|java/lang/Enum<P>|> : R|java/lang/Object| {
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
public final class ClassWithTypePRefSelfAndClass<P> : R|java/lang/Object| {
|
||||
public final class ClassWithTypePRefSelfAndClass<P : R|test/ClassWithTypePRefSelfAndClass<P>|> : R|java/lang/Object| {
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public open class MethodTypePOneUpperBound : R|java/lang/Object| {
|
||||
public open operator fun bar(): R|kotlin/Unit|
|
||||
public open operator fun <T : R|java/lang/Cloneable|> bar(): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public open class MethodTypePTwoUpperBounds : R|java/lang/Object| {
|
||||
public open operator fun foo(): R|kotlin/Unit|
|
||||
public open operator fun <T : R|java/lang/Cloneable|, R|java/lang/Runnable|> foo(): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public final class MethodWithTypeP : R|java/lang/Object| {
|
||||
public final operator fun f(): R|kotlin/Unit|
|
||||
public final operator fun <P> f(): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public final class MethodWithTypePP : R|java/lang/Object| {
|
||||
public final operator fun f(): R|kotlin/Unit|
|
||||
public final operator fun <P, Q : R|P|> f(): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public open class MethodWithTypePRefClassP<P> : R|java/lang/Object| {
|
||||
public final operator fun f(): R|kotlin/Unit|
|
||||
public final operator fun <Q : R|P|> f(): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public final class MethosWithPRefTP : R|java/lang/Object| {
|
||||
public final operator fun f(p: R|ft<P, P?>|!): R|kotlin/Unit|
|
||||
public final operator fun <P> f(p: R|ft<P, P?>|!): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
public abstract interface RawUpperBound<T> : R|java/lang/Object| {
|
||||
public abstract interface RawUpperBound<T : R|test/RawUpperBound<*>|> : R|java/lang/Object| {
|
||||
}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
public abstract interface RecursiveRawUpperBound<T> : R|java/lang/Object| {
|
||||
public abstract interface RecursiveRawUpperBound<T : R|test/RecursiveRawUpperBound<*>|> : R|java/lang/Object| {
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
public abstract interface RecursiveWildcardUpperBound<T> : R|java/lang/Object| {
|
||||
public abstract interface RecursiveWildcardUpperBound<T : R|test/RecursiveWildcardUpperBound<*>|> : R|java/lang/Object| {
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
public open class ConstructorGenericDeep : R|java/lang/Object| {
|
||||
public constructor(cl: R|ft<java/lang/Class<ft<P, P?>>, java/lang/Class<ft<P, P?>>?>|!): R|test/ConstructorGenericDeep|
|
||||
public constructor<P>(cl: R|ft<java/lang/Class<ft<P, P?>>, java/lang/Class<ft<P, P?>>?>|!): R|test/ConstructorGenericDeep|
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
public open class ConstructorGenericSimple : R|java/lang/Object| {
|
||||
public constructor(p: R|ft<P, P?>|!): R|test/ConstructorGenericSimple|
|
||||
public constructor<P>(p: R|ft<P, P?>|!): R|test/ConstructorGenericSimple|
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
public open class ConstructorGenericUpperBound : R|java/lang/Object| {
|
||||
public constructor(p: R|ft<P, P?>|!): R|test/ConstructorGenericUpperBound|
|
||||
public constructor<P : R|java/util/RandomAccess|>(p: R|ft<P, P?>|!): R|test/ConstructorGenericUpperBound|
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
public open class AllBoundsInWhen : R|java/lang/Object| {
|
||||
public open operator fun foo(): R|kotlin/Unit|
|
||||
public open operator fun <T : R|java/io/Serializable|> foo(): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
public open class ConstructorWithNewTypeParams<T> : R|java/lang/Object| {
|
||||
public constructor(first: R|ft<U, U?>|!): R|test/ConstructorWithNewTypeParams<T>|
|
||||
public constructor<T, U>(first: R|ft<U, U?>|!): R|test/ConstructorWithNewTypeParams<T>|
|
||||
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
public open class ConstructorWithParentTypeParams<T> : R|java/lang/Object| {
|
||||
public constructor(first: R|ft<T, T?>|!): R|test/ConstructorWithParentTypeParams<T>|
|
||||
public constructor<T>(first: R|ft<T, T?>|!): R|test/ConstructorWithParentTypeParams<T>|
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
public open class MethodWithMappedClasses : R|java/lang/Object| {
|
||||
public open operator fun copy(dest: R|ft<kotlin/collections/MutableList<in T>, kotlin/collections/List<in T>?>|!, src: R|ft<kotlin/collections/MutableList<ft<T, T?>>, kotlin/collections/List<ft<T, T?>>?>|!): R|kotlin/Unit|
|
||||
public open operator fun <T> copy(dest: R|ft<kotlin/collections/MutableList<in T>, kotlin/collections/List<in T>?>|!, src: R|ft<kotlin/collections/MutableList<ft<T, T?>>, kotlin/collections/List<ft<T, T?>>?>|!): R|kotlin/Unit|
|
||||
|
||||
public open operator fun copyMap(dest: R|ft<kotlin/collections/MutableMap<ft<kotlin/String, kotlin/String?>, in T>, kotlin/collections/Map<ft<kotlin/String, kotlin/String?>, in T>?>|!, src: R|ft<kotlin/collections/MutableMap<ft<kotlin/String, kotlin/String?>, ft<T, T?>>, kotlin/collections/Map<ft<kotlin/String, kotlin/String?>, ft<T, T?>>?>|!): R|kotlin/Unit|
|
||||
public open operator fun <T> copyMap(dest: R|ft<kotlin/collections/MutableMap<ft<kotlin/String, kotlin/String?>, in T>, kotlin/collections/Map<ft<kotlin/String, kotlin/String?>, in T>?>|!, src: R|ft<kotlin/collections/MutableMap<ft<kotlin/String, kotlin/String?>, ft<T, T?>>, kotlin/collections/Map<ft<kotlin/String, kotlin/String?>, ft<T, T?>>?>|!): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
public open class MethodWithTypeParameters : R|java/lang/Object| {
|
||||
public open operator fun foo(a: R|ft<A, A?>|!, b: R|ft<kotlin/collections/MutableList<out B>, kotlin/collections/List<out B>?>|!, list: R|ft<kotlin/collections/MutableList<in java/lang/String>, kotlin/collections/List<in java/lang/String>?>|!): R|kotlin/Unit|
|
||||
public open operator fun <A, B : R|java/lang/Runnable|, R|java/util/List<java/lang/Cloneable>|> foo(a: R|ft<A, A?>|!, b: R|ft<kotlin/collections/MutableList<out B>, kotlin/collections/List<out B>?>|!, list: R|ft<kotlin/collections/MutableList<in java/lang/String>, kotlin/collections/List<in java/lang/String>?>|!): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
public open class WrongTypeParameterBoundStructure1 : R|java/lang/Object| {
|
||||
public open operator fun foo(a: R|ft<A, A?>|!, b: R|ft<kotlin/collections/MutableList<out B>, kotlin/collections/List<out B>?>|!): R|kotlin/Unit|
|
||||
public open operator fun <A, B : R|java/lang/Runnable|, R|java/util/List<java/lang/Cloneable>|> foo(a: R|ft<A, A?>|!, b: R|ft<kotlin/collections/MutableList<out B>, kotlin/collections/List<out B>?>|!): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public open class Max : R|java/lang/Object| {
|
||||
public open operator fun max(coll: R|ft<kotlin/collections/MutableCollection<out T>, kotlin/collections/Collection<out T>?>|!): R|ft<T, T?>|!
|
||||
public open operator fun <T : R|java/lang/Object|, R|java/lang/Comparable<in T>|> max(coll: R|ft<kotlin/collections/MutableCollection<out T>, kotlin/collections/Collection<out T>?>|!): R|ft<T, T?>|!
|
||||
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,10 +1,10 @@
|
||||
public abstract interface LoadIterableWithNullability<T> : R|java/lang/Object| {
|
||||
@R|org/jetbrains/annotations/NotNull|() @R|kotlin/annotations/jvm/Mutable|() public abstract operator fun getIterable(): R|ft<kotlin/collections/MutableIterable<ft<T, T?>>, kotlin/collections/MutableIterable<ft<T, T?>>>|
|
||||
@R|org/jetbrains/annotations/NotNull|() @R|kotlin/annotations/jvm/Mutable|() public abstract operator fun getIterable(): R|kotlin/collections/MutableIterable<ft<T, T?>>|
|
||||
|
||||
public abstract operator fun setIterable(@R|kotlin/annotations/jvm/Mutable|() @R|org/jetbrains/annotations/NotNull|() Iterable: R|ft<kotlin/collections/MutableIterable<ft<T, T?>>, kotlin/collections/MutableIterable<ft<T, T?>>>|): R|kotlin/Unit|
|
||||
public abstract operator fun setIterable(@R|kotlin/annotations/jvm/Mutable|() @R|org/jetbrains/annotations/NotNull|() Iterable: R|kotlin/collections/MutableIterable<ft<T, T?>>|): R|kotlin/Unit|
|
||||
|
||||
@R|org/jetbrains/annotations/NotNull|() @R|kotlin/annotations/jvm/ReadOnly|() public abstract operator fun getReadOnlyIterable(): R|ft<kotlin/collections/Iterable<ft<T, T?>>, kotlin/collections/Iterable<ft<T, T?>>>|
|
||||
@R|org/jetbrains/annotations/NotNull|() @R|kotlin/annotations/jvm/ReadOnly|() public abstract operator fun getReadOnlyIterable(): R|kotlin/collections/Iterable<ft<T, T?>>|
|
||||
|
||||
public abstract operator fun setReadOnlyIterable(@R|kotlin/annotations/jvm/ReadOnly|() @R|org/jetbrains/annotations/NotNull|() Iterable: R|ft<kotlin/collections/Iterable<ft<T, T?>>, kotlin/collections/Iterable<ft<T, T?>>>|): R|kotlin/Unit|
|
||||
public abstract operator fun setReadOnlyIterable(@R|kotlin/annotations/jvm/ReadOnly|() @R|org/jetbrains/annotations/NotNull|() Iterable: R|kotlin/collections/Iterable<ft<T, T?>>|): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
public abstract interface GenericInterfaceParameterWithSelfBound<T> : R|java/lang/Object| {
|
||||
public abstract interface GenericInterfaceParameterWithSelfBound<T : R|test/GenericInterfaceParameterWithSelfBound<T>|> : R|java/lang/Object| {
|
||||
public abstract operator fun method(t: R|ft<T, T?>|!): R|ft<T, T?>|!
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
public abstract interface GenericInterfaceParametersWithBounds<A, B> : R|java/lang/Object| {
|
||||
public abstract interface GenericInterfaceParametersWithBounds<A : R|java/lang/Comparable<A>|, R|java/lang/Cloneable|, B : R|java/util/List<A>|> : R|java/lang/Object| {
|
||||
public abstract operator fun method(a: R|kotlin/Array<ft<A, A?>>|, b: R|ft<B, B?>|!): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
public abstract interface GenericMethodParameters : R|java/lang/Object| {
|
||||
public abstract operator fun method(a: R|kotlin/Array<ft<A, A?>>|, b: R|ft<B, B?>|!): R|kotlin/Unit|
|
||||
public abstract operator fun <A : R|java/lang/CharSequence|, B : R|java/util/List<A>|> method(a: R|kotlin/Array<ft<A, A?>>|, b: R|ft<B, B?>|!): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
public open class TypeParameterOfMethod : R|java/lang/Object| {
|
||||
public open static operator fun max(comparator: R|ft<java/util/Comparator<ft<T, T?>>, java/util/Comparator<ft<T, T?>>?>|!, value1: R|ft<T, T?>|!, value2: R|ft<T, T?>|!): R|ft<T, T?>|!
|
||||
public open static operator fun <T> max(comparator: R|ft<java/util/Comparator<ft<T, T?>>, java/util/Comparator<ft<T, T?>>?>|!, value1: R|ft<T, T?>|!, value2: R|ft<T, T?>|!): R|ft<T, T?>|!
|
||||
|
||||
public open static operator fun max2(comparator: R|ft<java/util/Comparator<ft<T, T?>>, java/util/Comparator<ft<T, T?>>?>|!, value1: R|ft<T, T?>|!, value2: R|ft<T, T?>|!): R|ft<T, T?>|!
|
||||
public open static operator fun <T : R|java/lang/CharSequence|> max2(comparator: R|ft<java/util/Comparator<ft<T, T?>>, java/util/Comparator<ft<T, T?>>?>|!, value1: R|ft<T, T?>|!, value2: R|ft<T, T?>|!): R|ft<T, T?>|!
|
||||
|
||||
public open static operator fun method(a: R|ft<java/util/Comparator<ft<A, A?>>, java/util/Comparator<ft<A, A?>>?>|!, b: R|ft<B, B?>|!): R|kotlin/Unit|
|
||||
public open static operator fun <A : R|java/lang/CharSequence|, B : R|java/util/List<A>|> method(a: R|ft<java/util/Comparator<ft<A, A?>>, java/util/Comparator<ft<A, A?>>?>|!, b: R|ft<B, B?>|!): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
|
||||
@@ -15,6 +15,6 @@ public final enum class StaticMembersInEnum : R|java/lang/Enum<test/StaticMember
|
||||
|
||||
public open static operator fun valueOf(x: R|kotlin/Int|): R|kotlin/Unit|
|
||||
|
||||
public open static operator fun valueOf(<anonymous Java parameter>: R|ft<java/lang/Class<ft<T, T?>>, java/lang/Class<ft<T, T?>>?>|!, <anonymous Java parameter>: R|ft<kotlin/String, kotlin/String?>|!): R|ft<T, T?>|!
|
||||
public open static operator fun <T : R|java/lang/Enum<T>|> valueOf(<anonymous Java parameter>: R|ft<java/lang/Class<ft<T, T?>>, java/lang/Class<ft<T, T?>>?>|!, <anonymous Java parameter>: R|ft<kotlin/String, kotlin/String?>|!): R|ft<T, T?>|!
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user