FIR deserializer: load type-parameters correctly

This commit is contained in:
Simon Ogorodnik
2019-04-08 15:44:09 +03:00
committed by Mikhail Glukhikh
parent 853167a24d
commit 649c2f6bcc
54 changed files with 164 additions and 118 deletions
+10 -10
View File
@@ -25,7 +25,7 @@ public abstract class CharIterator : R|kotlin/collections/Iterator<kotlin/Char>|
}
public abstract interface Collection<E> : R|kotlin/collections/Iterable<E>| {
public abstract interface Collection<out E> : R|kotlin/collections/Iterable<E>| {
public abstract operator fun contains(element: R|E|): R|kotlin/Boolean|
public abstract fun containsAll(elements: R|kotlin/collections/Collection<E>|): R|kotlin/Boolean|
@@ -63,19 +63,19 @@ public abstract class IntIterator : R|kotlin/collections/Iterator<kotlin/Int>| {
}
public abstract interface Iterable<T> : R|kotlin/Any| {
public abstract interface Iterable<out T> : R|kotlin/Any| {
public abstract operator fun iterator(): R|kotlin/collections/Iterator<T>|
}
public abstract interface Iterator<T> : R|kotlin/Any| {
public abstract interface Iterator<out T> : R|kotlin/Any| {
public abstract operator fun hasNext(): R|kotlin/Boolean|
public abstract operator fun next(): R|T|
}
public abstract interface List<E> : R|kotlin/collections/Collection<E>| {
public abstract interface List<out E> : R|kotlin/collections/Collection<E>| {
public abstract operator fun contains(element: R|E|): R|kotlin/Boolean|
public abstract fun containsAll(elements: R|kotlin/collections/Collection<E>|): R|kotlin/Boolean|
@@ -98,7 +98,7 @@ public abstract interface List<E> : R|kotlin/collections/Collection<E>| {
}
public abstract interface ListIterator<T> : R|kotlin/collections/Iterator<T>| {
public abstract interface ListIterator<out T> : R|kotlin/collections/Iterator<T>| {
public abstract operator fun hasNext(): R|kotlin/Boolean|
public abstract fun hasPrevious(): R|kotlin/Boolean|
@@ -122,7 +122,7 @@ public abstract class LongIterator : R|kotlin/collections/Iterator<kotlin/Long>|
}
public abstract interface Map<K, V> : R|kotlin/Any| {
public abstract interface Map<K, out V> : R|kotlin/Any| {
public abstract fun containsKey(key: R|K|): R|kotlin/Boolean|
public abstract fun containsValue(value: R|V|): R|kotlin/Boolean|
@@ -133,7 +133,7 @@ public abstract interface Map<K, V> : R|kotlin/Any| {
public abstract fun isEmpty(): R|kotlin/Boolean|
public abstract interface Entry<K, V> : R|kotlin/Any| {
public abstract interface Entry<out K, out V> : R|kotlin/Any| {
}
}
@@ -155,12 +155,12 @@ public abstract interface MutableCollection<E> : R|kotlin/collections/Collection
}
public abstract interface MutableIterable<T> : R|kotlin/collections/Iterable<T>| {
public abstract interface MutableIterable<out T> : R|kotlin/collections/Iterable<T>| {
public abstract operator fun iterator(): R|kotlin/collections/MutableIterator<T>|
}
public abstract interface MutableIterator<T> : R|kotlin/collections/Iterator<T>| {
public abstract interface MutableIterator<out T> : R|kotlin/collections/Iterator<T>| {
public abstract fun remove(): R|kotlin/Unit|
}
@@ -242,7 +242,7 @@ public abstract interface MutableSet<E> : R|kotlin/collections/Set<E>|, R|kotlin
}
public abstract interface Set<E> : R|kotlin/collections/Collection<E>| {
public abstract interface Set<out E> : R|kotlin/collections/Collection<E>| {
public abstract operator fun contains(element: R|E|): R|kotlin/Boolean|
public abstract fun containsAll(elements: R|kotlin/collections/Collection<E>|): R|kotlin/Boolean|
+7 -7
View File
@@ -1,6 +1,6 @@
public final inline fun <T> arrayOf(vararg elements: R|kotlin/Array<out T>|): R|kotlin/Array<T>|
public final inline fun <reified T> arrayOf(vararg elements: R|kotlin/Array<out T>|): R|kotlin/Array<T>|
public final fun <T> arrayOfNulls(size: R|kotlin/Int|): R|kotlin/Array<T>|
public final fun <reified T> arrayOfNulls(size: R|kotlin/Int|): R|kotlin/Array<T>|
public final fun booleanArrayOf(vararg elements: R|kotlin/BooleanArray|): R|kotlin/BooleanArray|
@@ -10,11 +10,11 @@ public final fun charArrayOf(vararg elements: R|kotlin/CharArray|): R|kotlin/Cha
public final fun doubleArrayOf(vararg elements: R|kotlin/DoubleArray|): R|kotlin/DoubleArray|
public final inline fun <T> emptyArray(): R|kotlin/Array<T>|
public final inline fun <reified T> emptyArray(): R|kotlin/Array<T>|
public final inline fun <T> enumValueOf(name: R|kotlin/String|): R|T|
public final inline fun <reified T> enumValueOf(name: R|kotlin/String|): R|T|
public final inline fun <T> enumValues(): R|kotlin/Array<T>|
public final inline fun <reified T> enumValues(): R|kotlin/Array<T>|
public final fun floatArrayOf(vararg elements: R|kotlin/FloatArray|): R|kotlin/FloatArray|
@@ -286,7 +286,7 @@ public abstract interface Cloneable : R|kotlin/Any| {
}
public abstract interface Comparable<T> : R|kotlin/Any| {
public abstract interface Comparable<in T> : R|kotlin/Any| {
public abstract operator fun compareTo(other: R|T|): R|kotlin/Int|
}
@@ -589,7 +589,7 @@ public final class FloatArray : R|kotlin/Any| {
}
public abstract interface Function<R> : R|kotlin/Any| {
public abstract interface Function<out R> : R|kotlin/Any| {
}
public final class Int : R|kotlin/Number|, R|kotlin/Comparable<kotlin/Int>| {
@@ -24,7 +24,7 @@ public final class Generic<T> : R|kotlin/Any| {
public final class InnerGeneric<A, B> : R|kotlin/Any| {
public constructor(): R|test/InnerGeneric<A, B>|
public final inner class Inner<C, D> : R|kotlin/Any| {
public final inner class Inner<in C, D : R|A|> : R|kotlin/Any| {
public constructor(): R|test/InnerGeneric.Inner<C, D>|
}
@@ -3,7 +3,7 @@ public final annotation class A : R|kotlin/Annotation| {
}
public abstract interface Foo<T> : R|java/io/Serializable| {
public abstract fun <E, F> bar(): R|kotlin/Unit|
public abstract interface Foo<T : R|kotlin/Number|> : R|java/io/Serializable| {
public abstract fun <E, F : R|E|> bar(): R|kotlin/Unit|
}
@@ -1,4 +1,4 @@
public final class Wine<T> : R|kotlin/Any| {
public final class Wine<in T> : R|kotlin/Any| {
public constructor(): R|test/Wine<T>|
}
@@ -1,4 +1,4 @@
public final class Juice<T> : R|kotlin/Any| {
public final class Juice<out T> : R|kotlin/Any| {
public constructor(): R|test/Juice<T>|
}
@@ -1,4 +1,4 @@
public final class ClassParamReferencesParam<A, B> : R|kotlin/Any| {
public final class ClassParamReferencesParam<A, B : R|A|> : R|kotlin/Any| {
public constructor(): R|test/ClassParamReferencesParam<A, B>|
}
@@ -1,4 +1,4 @@
public final class ClassParamReferencesParam<A, B> : R|kotlin/Any| {
public final class ClassParamReferencesParam<A, in B : R|A|> : R|kotlin/Any| {
public constructor(): R|test/ClassParamReferencesParam<A, B>|
}
@@ -1,4 +1,4 @@
public final class ClassParamReferencesSelf<A> : R|kotlin/Any| {
public final class ClassParamReferencesSelf<A : R|test/TraitWithP<A>|> : R|kotlin/Any| {
public constructor(): R|test/ClassParamReferencesSelf<A>|
}
@@ -1,4 +1,4 @@
public final class Clock<A> : R|kotlin/Any| {
public final class Clock<A : R|java/lang/Number|> : R|kotlin/Any| {
public constructor(): R|test/Clock<A>|
}
@@ -1,4 +1,4 @@
public final class Clock<A> : R|kotlin/Any| {
public final class Clock<A : R|java/lang/Number|, R|java/io/Serializable|> : R|kotlin/Any| {
public constructor(): R|test/Clock<A>|
}
@@ -1,4 +1,4 @@
public final class Clock<A> : R|kotlin/Any| {
public final class Clock<A : R|java/io/Serializable|> : R|kotlin/Any| {
public constructor(): R|test/Clock<A>|
}
@@ -1,4 +1,4 @@
public final class ClassTwoParams<P, Q> : R|kotlin/Any| {
public final class ClassTwoParams<out P, Q> : R|kotlin/Any| {
public constructor(): R|test/ClassTwoParams<P, Q>|
}
@@ -1,4 +1,4 @@
public abstract interface Rec<R, T> : R|kotlin/Any| {
public abstract interface Rec<R, out T : R|test/Rec<R, T>|> : R|kotlin/Any| {
public abstract fun t(): R|T|
}
@@ -1,4 +1,4 @@
public final class ClassParamUsedInFun<T> : R|kotlin/Any| {
public final class ClassParamUsedInFun<in T> : R|kotlin/Any| {
public final fun f(t: R|T|): R|kotlin/Int|
public constructor(): R|test/ClassParamUsedInFun<T>|
@@ -1,4 +1,4 @@
public final class ClassWithTypePP<P, Q> : R|kotlin/Any| {
public final class ClassWithTypePP<P, Q : R|P|> : R|kotlin/Any| {
public constructor(): R|test/ClassWithTypePP<P, Q>|
}
@@ -1,4 +1,4 @@
public open class ClassWithTypePRefNext<R, P> : R|kotlin/Any| {
public open class ClassWithTypePRefNext<R : R|kotlin/collections/Iterable<P>|?, P> : R|kotlin/Any| {
public constructor(): R|test/ClassWithTypePRefNext<R, P>|
}
@@ -1,4 +1,4 @@
public final class ClassWithTypePRefSelf<P> : R|kotlin/Any| {
public final class ClassWithTypePRefSelf<P : R|kotlin/Enum<P>|> : R|kotlin/Any| {
public constructor(): R|test/ClassWithTypePRefSelf<P>|
}
@@ -1,4 +1,4 @@
public final class ClassWithTypePRefSelfAndClass<P> : R|kotlin/Any| {
public final class ClassWithTypePRefSelfAndClass<P : R|test/ClassWithTypePRefSelfAndClass<P>|?> : R|kotlin/Any| {
public constructor(): R|test/ClassWithTypePRefSelfAndClass<P>|
}
@@ -1,5 +1,5 @@
public open class MethodTypePOneUpperBound : R|kotlin/Any| {
public open fun <T> bar(): R|kotlin/Unit|
public open fun <T : R|kotlin/Cloneable|?> bar(): R|kotlin/Unit|
public constructor(): R|test/MethodTypePOneUpperBound|
@@ -1,5 +1,5 @@
public open class MethodTypePTwoUpperBounds : R|kotlin/Any| {
public open fun <T> foo(): R|kotlin/Unit|
public open fun <T : R|kotlin/Cloneable|?, R|java/lang/Runnable|?> foo(): R|kotlin/Unit|
public constructor(): R|test/MethodTypePTwoUpperBounds|
@@ -1,5 +1,5 @@
public final class MethodWithTypePP : R|kotlin/Any| {
public final fun <P, Q> f(): R|kotlin/Unit|
public final fun <P, Q : R|P|> f(): R|kotlin/Unit|
public constructor(): R|test/MethodWithTypePP|
@@ -1,5 +1,5 @@
public open class MethodWithTypePRefClassP<P> : R|kotlin/Any| {
public final fun <Q> f(): R|kotlin/Unit|
public final fun <Q : R|P|> f(): R|kotlin/Unit|
public constructor(): R|test/MethodWithTypePRefClassP<P>|
@@ -3,7 +3,7 @@ public final class UnboundWildcard : R|kotlin/Any| {
public constructor(): R|test/UnboundWildcard|
public abstract interface MyClass<T> : R|kotlin/Any| {
public abstract interface MyClass<T : R|kotlin/CharSequence|?> : R|kotlin/Any| {
}
}
@@ -1,5 +1,5 @@
public open class AllBoundsInWhen : R|kotlin/Any| {
public open fun <T> foo(): R|kotlin/Unit|
public open fun <T : R|java/io/Serializable|> foo(): R|kotlin/Unit|
public constructor(): R|test/AllBoundsInWhen|
@@ -1,5 +1,5 @@
public open class MethodWithTypeParameters : R|kotlin/Any| {
public open fun <A, B> foo(a: R|A|, b: R|kotlin/collections/List<B>|, c: R|kotlin/collections/MutableList<in kotlin/String>|): R|kotlin/Unit|
public open fun <A, B : R|java/lang/Runnable|, R|kotlin/collections/List<kotlin/Cloneable>|> foo(a: R|A|, b: R|kotlin/collections/List<B>|, c: R|kotlin/collections/MutableList<in kotlin/String>|): R|kotlin/Unit|
public constructor(): R|test/MethodWithTypeParameters|
@@ -3,7 +3,7 @@ public final class StarProjection : R|kotlin/Any| {
public constructor(): R|test/StarProjection|
public abstract interface MyClass<T> : R|kotlin/Any| {
public abstract interface MyClass<T : R|kotlin/CharSequence|?> : R|kotlin/Any| {
}
}
@@ -1,5 +1,5 @@
public open class ExtraUpperBound : R|kotlin/Any| {
public open fun <A> foo(): R|kotlin/String|?
public open fun <A : R|java/lang/Runnable|?> foo(): R|kotlin/String|?
public constructor(): R|test/ExtraUpperBound|
@@ -1,5 +1,5 @@
public open class MissingUpperBound : R|kotlin/Any| {
public open fun <A> foo(): R|kotlin/String|?
public open fun <A : R|java/lang/Runnable|?, R|kotlin/Cloneable|?> foo(): R|kotlin/String|?
public constructor(): R|test/MissingUpperBound|
@@ -1,5 +1,5 @@
public open class WrongTypeParameterBoundStructure1 : R|kotlin/Any| {
public open fun <A, B> foo(p0: R|A|, p1: R|kotlin/collections/List<B>|?): R|kotlin/Unit|
public open fun <A, B : R|java/lang/Runnable|?, R|kotlin/collections/List<kotlin/Cloneable>|?> foo(p0: R|A|, p1: R|kotlin/collections/List<B>|?): R|kotlin/Unit|
public constructor(): R|test/WrongTypeParameterBoundStructure1|
@@ -1,5 +1,5 @@
public open class WrongTypeParameterBoundStructure2 : R|kotlin/Any| {
public open fun <A, B> foo(p0: R|A|, p1: R|kotlin/collections/List<B>|?): R|kotlin/Unit|
public open fun <A, B : R|java/lang/Runnable|?, R|kotlin/collections/List<kotlin/Cloneable>|?> foo(p0: R|A|, p1: R|kotlin/collections/List<B>|?): R|kotlin/Unit|
public constructor(): R|test/WrongTypeParameterBoundStructure2|
@@ -1,11 +1,11 @@
public abstract interface InheritMutability : R|kotlin/Any| {
public abstract interface Sub : R|test/InheritMutability.Super| {
public abstract fun <B> foo(a: R|B|): R|kotlin/Unit|
public abstract fun <B : R|kotlin/collections/MutableList<kotlin/String>|> foo(a: R|B|): R|kotlin/Unit|
}
public abstract interface Super : R|kotlin/Any| {
public abstract fun <A> foo(a: R|A|): R|kotlin/Unit|
public abstract fun <A : R|kotlin/collections/MutableList<kotlin/String>|> foo(a: R|A|): R|kotlin/Unit|
}
@@ -1,11 +1,11 @@
public abstract interface InheritNullability : R|kotlin/Any| {
public abstract interface Sub : R|test/InheritNullability.Super| {
public abstract fun <B> foo(a: R|B|): R|kotlin/Unit|
public abstract fun <B : R|kotlin/CharSequence|> foo(a: R|B|): R|kotlin/Unit|
}
public abstract interface Super : R|kotlin/Any| {
public abstract fun <A> foo(a: R|A|): R|kotlin/Unit|
public abstract fun <A : R|kotlin/CharSequence|> foo(a: R|A|): R|kotlin/Unit|
}
@@ -1,11 +1,11 @@
public abstract interface InheritReadOnliness : R|kotlin/Any| {
public abstract interface Sub : R|test/InheritReadOnliness.Super| {
public abstract fun <B> foo(a: R|B|): R|kotlin/Unit|
public abstract fun <B : R|kotlin/collections/List<kotlin/String>|> foo(a: R|B|): R|kotlin/Unit|
}
public abstract interface Super : R|kotlin/Any| {
public abstract fun <A> foo(a: R|A|): R|kotlin/Unit|
public abstract fun <A : R|kotlin/collections/List<kotlin/String>|> foo(a: R|A|): R|kotlin/Unit|
}
@@ -1,11 +1,11 @@
public abstract interface TwoBounds : R|kotlin/Any| {
public abstract interface Sub : R|test/TwoBounds.Super| {
public abstract fun <B> foo(a: R|B|): R|kotlin/Unit|
public abstract fun <B : R|kotlin/CharSequence|, R|kotlin/Cloneable|> foo(a: R|B|): R|kotlin/Unit|
}
public abstract interface Super : R|kotlin/Any| {
public abstract fun <A> foo(a: R|A|): R|kotlin/Unit|
public abstract fun <A : R|kotlin/CharSequence|, R|kotlin/Cloneable|> foo(a: R|A|): R|kotlin/Unit|
}
@@ -1,16 +1,16 @@
public abstract interface TwoSuperclasses : R|kotlin/Any| {
public abstract interface Sub : R|test/TwoSuperclasses.Super1|, R|test/TwoSuperclasses.Super2| {
public abstract fun <C> foo(a: R|C|): R|kotlin/Unit|
public abstract fun <C : R|kotlin/CharSequence|> foo(a: R|C|): R|kotlin/Unit|
}
public abstract interface Super1 : R|kotlin/Any| {
public abstract fun <A> foo(a: R|A|): R|kotlin/Unit|
public abstract fun <A : R|kotlin/CharSequence|> foo(a: R|A|): R|kotlin/Unit|
}
public abstract interface Super2 : R|kotlin/Any| {
public abstract fun <B> foo(a: R|B|): R|kotlin/Unit|
public abstract fun <B : R|kotlin/CharSequence|> foo(a: R|B|): R|kotlin/Unit|
}
@@ -1,11 +1,11 @@
public abstract interface TwoTypeParameters : R|kotlin/Any| {
public abstract interface Sub : R|test/TwoTypeParameters.Super| {
public abstract fun <B, A> foo(a: R|B|, b: R|A|): R|kotlin/Unit|
public abstract fun <B : R|kotlin/CharSequence|, A : R|kotlin/Cloneable|> foo(a: R|B|, b: R|A|): R|kotlin/Unit|
}
public abstract interface Super : R|kotlin/Any| {
public abstract fun <A, B> foo(a: R|A|, b: R|B|): R|kotlin/Unit|
public abstract fun <A : R|kotlin/CharSequence|, B : R|kotlin/Cloneable|> foo(a: R|A|, b: R|B|): R|kotlin/Unit|
}
@@ -1,11 +1,11 @@
public abstract interface UseParameterAsUpperBound : R|kotlin/Any| {
public abstract interface Sub : R|test/UseParameterAsUpperBound.Super| {
public abstract fun <B, A> foo(a: R|B|, b: R|A|): R|kotlin/Unit|
public abstract fun <B, A : R|B|> foo(a: R|B|, b: R|A|): R|kotlin/Unit|
}
public abstract interface Super : R|kotlin/Any| {
public abstract fun <A, B> foo(a: R|A|, b: R|B|): R|kotlin/Unit|
public abstract fun <A, B : R|A|> foo(a: R|A|, b: R|B|): R|kotlin/Unit|
}
@@ -1,11 +1,11 @@
public abstract interface UseParameterInUpperBound : R|kotlin/Any| {
public abstract interface Sub : R|test/UseParameterInUpperBound.Super| {
public abstract fun <B, A> foo(a: R|B|, b: R|A|): R|kotlin/Unit|
public abstract fun <B, A : R|kotlin/collections/List<B>|> foo(a: R|B|, b: R|A|): R|kotlin/Unit|
}
public abstract interface Super : R|kotlin/Any| {
public abstract fun <A, B> foo(a: R|A|, b: R|B|): R|kotlin/Unit|
public abstract fun <A, B : R|kotlin/collections/List<A>|> foo(a: R|A|, b: R|B|): R|kotlin/Unit|
}
@@ -1,11 +1,11 @@
public abstract interface UseParameterInUpperBoundWithKotlinSignature : R|kotlin/Any| {
public abstract interface Sub : R|test/UseParameterInUpperBoundWithKotlinSignature.Super| {
public abstract fun <B, A> foo(b: R|B|, a: R|A|): R|kotlin/Unit|
public abstract fun <B, A : R|kotlin/collections/List<B>|> foo(b: R|B|, a: R|A|): R|kotlin/Unit|
}
public abstract interface Super : R|kotlin/Any| {
public abstract fun <A, B> foo(a: R|A|, b: R|B|): R|kotlin/Unit|
public abstract fun <A, B : R|kotlin/collections/List<A>|> foo(a: R|A|, b: R|B|): R|kotlin/Unit|
}
@@ -1,5 +1,5 @@
public open class Max : R|kotlin/Any| {
public open fun <T> max(p0: R|kotlin/collections/Collection<T>|?): R|T|
public open fun <T : R|kotlin/Any|?, R|kotlin/Comparable<T>|?> max(p0: R|kotlin/collections/Collection<T>|?): R|T|
public constructor(): R|test/Max|
@@ -1 +1,2 @@
public final fun <P, Q> funParamReferencesParam(): R|kotlin/Int|
public final fun <P, Q : R|P|> funParamReferencesParam(): R|kotlin/Int|
@@ -1,4 +1,4 @@
public final fun <T> foo(): R|kotlin/Unit|
public final fun <T : R|test/Foo|, R|test/Bar|> foo(): R|kotlin/Unit|
public abstract interface Bar : R|kotlin/Any| {
}
@@ -1 +1,2 @@
public final fun <A> uno(): R|kotlin/Int|
public final fun <A : R|java/lang/Number|> uno(): R|kotlin/Int|
@@ -1 +1,2 @@
public final fun <A> tres(): R|kotlin/Int|
public final fun <A : R|java/lang/Number|, R|java/io/Serializable|> tres(): R|kotlin/Int|
@@ -1 +1,2 @@
public final fun <A> dos(): R|kotlin/Int|
public final fun <A : R|java/io/Serializable|> dos(): R|kotlin/Int|
@@ -1,7 +1,7 @@
public final class InnerClassReferencesOuterTP<P> : R|kotlin/Any| {
public constructor(): R|test/InnerClassReferencesOuterTP<P>|
public final inner class Inner<Q> : R|kotlin/Any| {
public final inner class Inner<Q : R|P|> : R|kotlin/Any| {
public constructor(): R|test/InnerClassReferencesOuterTP.Inner<Q>|
}
@@ -2,7 +2,7 @@ public final class MembersReferenceOuterTP<P> : R|kotlin/Any| {
public constructor(): R|test/MembersReferenceOuterTP<P>|
public final inner class Inner : R|kotlin/Any| {
public final fun <Q> f(): R|kotlin/Unit|
public final fun <Q : R|P|> f(): R|kotlin/Unit|
public final fun g(p: R|P|): R|P|
@@ -1,4 +1,4 @@
public final class A<I> : R|kotlin/Any| {
public final class A<in I> : R|kotlin/Any| {
private/*private to this*/ final fun bas(): R|I|
public constructor(): R|test/A<I>|