FIR deserializer: use class type parameters in constructor directly
This allows calls like Pair(...) to be resolved correctly
This commit is contained in:
+1
-6
@@ -23,7 +23,6 @@ import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.serialization.deserialization.ProtoEnumFlags
|
||||
import org.jetbrains.kotlin.serialization.deserialization.getName
|
||||
import org.jetbrains.kotlin.types.Variance
|
||||
|
||||
class FirDeserializationContext(
|
||||
val nameResolver: NameResolver,
|
||||
@@ -234,11 +233,7 @@ class FirMemberDeserializer(private val c: FirDeserializationContext) {
|
||||
val local = c.childContext(emptyList())
|
||||
val isPrimary = !Flags.IS_SECONDARY.get(flags)
|
||||
|
||||
val typeParameters = klass.typeParameters.map {
|
||||
FirTypeParameterImpl(c.session, null, FirTypeParameterSymbol(), it.name, Variance.INVARIANT, false).apply {
|
||||
bounds.addAll(it.bounds)
|
||||
}
|
||||
}
|
||||
val typeParameters = klass.typeParameters
|
||||
|
||||
val delegatedSelfType = FirResolvedTypeRefImpl(
|
||||
null,
|
||||
|
||||
Vendored
+1
-1
@@ -28,7 +28,7 @@ public final class InnerGeneric<A, B> : R|kotlin/Any| {
|
||||
public constructor<A, B>(): R|test/InnerGeneric<A, B>|
|
||||
|
||||
public final inner class Inner<in C, D : R|A|> : R|kotlin/Any| {
|
||||
public constructor<C, D : R|A|>(): R|test/InnerGeneric.Inner<C, D>|
|
||||
public constructor<in C, D : R|A|>(): R|test/InnerGeneric.Inner<C, D>|
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public final class Wine<in T> : R|kotlin/Any| {
|
||||
public constructor<T>(): R|test/Wine<T>|
|
||||
public constructor<in T>(): R|test/Wine<T>|
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public final class Juice<out T> : R|kotlin/Any| {
|
||||
public constructor<T>(): R|test/Juice<T>|
|
||||
public constructor<out T>(): R|test/Juice<T>|
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
public final class ClassParamReferencesParam<A, in B : R|A|> : R|kotlin/Any| {
|
||||
public constructor<A, B : R|A|>(): R|test/ClassParamReferencesParam<A, B>|
|
||||
public constructor<A, in B : R|A|>(): R|test/ClassParamReferencesParam<A, B>|
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public final class ClassTwoParams<out P, Q> : R|kotlin/Any| {
|
||||
public constructor<P, Q>(): R|test/ClassTwoParams<P, Q>|
|
||||
public constructor<out P, Q>(): R|test/ClassTwoParams<P, Q>|
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
public final class ClassParamUsedInFun<in T> : R|kotlin/Any| {
|
||||
public final fun f(t: R|T|): R|kotlin/Int|
|
||||
|
||||
public constructor<T>(): R|test/ClassParamUsedInFun<T>|
|
||||
public constructor<in T>(): R|test/ClassParamUsedInFun<T>|
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -15,6 +15,6 @@ public final class A<in I> : R|kotlin/Any| {
|
||||
private/*private to this*/ get(): R|I|
|
||||
private/*private to this*/ set(value: R|I|): kotlin/Unit
|
||||
|
||||
public constructor<I>(): R|test/A<I>|
|
||||
public constructor<in I>(): R|test/A<I>|
|
||||
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ FILE: problems.kt
|
||||
}
|
||||
public final val t: <ERROR TYPE REF: Ambiguity: bar, [/bar, /bar]> = String().<Ambiguity: bar, [/bar, /bar]>#
|
||||
public get(): <ERROR TYPE REF: Ambiguity: bar, [/bar, /bar]>
|
||||
public final val p: <ERROR TYPE REF: Inapplicable(INAPPLICABLE): [kotlin/Pair.Pair]> = <Inapplicable(INAPPLICABLE): [kotlin/Pair.Pair]>#(Int(0), String())
|
||||
public get(): <ERROR TYPE REF: Inapplicable(INAPPLICABLE): [kotlin/Pair.Pair]>
|
||||
public final val p: R|kotlin/Pair<kotlin/Int, kotlin/String>| = R|kotlin/Pair.Pair|<R|kotlin/Int|, R|kotlin/String|>(Int(0), String())
|
||||
public get(): R|kotlin/Pair<kotlin/Int, kotlin/String>|
|
||||
public final class Base<T> : R|kotlin/Any| {
|
||||
public constructor<T>(x: R|T|): R|Base<T>| {
|
||||
super<R|kotlin/Any|>()
|
||||
|
||||
+2
-2
@@ -15,8 +15,8 @@ FILE fqName:<root> fileName:/genericConstructorCallWithTypeArguments.kt
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (size: kotlin.Int, init: kotlin.Function1<kotlin.Int, T of kotlin.Array>) declared in kotlin.Array' type=kotlin.Array<T of <root>.testArray> origin=null
|
||||
<class: T>: <none>
|
||||
size: GET_VAR 'n: kotlin.Int declared in <root>.testArray' type=kotlin.Int origin=null
|
||||
init: FUN_EXPR type=kotlin.Function1<kotlin.Int, T of kotlin.Array> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (it:kotlin.Int) returnType:T of kotlin.Array
|
||||
init: FUN_EXPR type=kotlin.Function1<kotlin.Int, T of <root>.testArray> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (it:kotlin.Int) returnType:T of <root>.testArray
|
||||
VALUE_PARAMETER name:it index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
CALL 'public abstract fun invoke (): T of <root>.testArray declared in kotlin.Function0' type=T of <root>.testArray origin=null
|
||||
|
||||
Reference in New Issue
Block a user