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
@@ -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>|