AA FIR: use fully expanded type when computing optimal type mapping mode
^KT-61460 Fixed
This commit is contained in:
+8
-4
@@ -82,10 +82,14 @@ internal class KtFirPsiTypeProvider(
|
||||
KtTypeMappingMode.SUPER_TYPE -> TypeMappingMode.SUPER_TYPE
|
||||
KtTypeMappingMode.SUPER_TYPE_KOTLIN_COLLECTIONS_AS_IS -> TypeMappingMode.SUPER_TYPE_KOTLIN_COLLECTIONS_AS_IS
|
||||
KtTypeMappingMode.RETURN_TYPE_BOXED -> TypeMappingMode.RETURN_TYPE_BOXED
|
||||
KtTypeMappingMode.RETURN_TYPE ->
|
||||
rootModuleSession.jvmTypeMapper.typeContext.getOptimalModeForReturnType(type.coneType, isAnnotationMethod)
|
||||
KtTypeMappingMode.VALUE_PARAMETER ->
|
||||
rootModuleSession.jvmTypeMapper.typeContext.getOptimalModeForValueParameter(type.coneType)
|
||||
KtTypeMappingMode.RETURN_TYPE -> {
|
||||
val expandedType = type.coneType.fullyExpandedType(rootModuleSession)
|
||||
rootModuleSession.jvmTypeMapper.typeContext.getOptimalModeForReturnType(expandedType, isAnnotationMethod)
|
||||
}
|
||||
KtTypeMappingMode.VALUE_PARAMETER -> {
|
||||
val expandedType = type.coneType.fullyExpandedType(rootModuleSession)
|
||||
rootModuleSession.jvmTypeMapper.typeContext.getOptimalModeForValueParameter(expandedType)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+10
@@ -4,6 +4,16 @@ public abstract interface A /* A*/ {
|
||||
public abstract interface B /* B*/<T, R> {
|
||||
}
|
||||
|
||||
public final class Foo /* Foo*/ {
|
||||
@org.jetbrains.annotations.Nullable()
|
||||
private final kotlin.jvm.functions.Function0<java.lang.Boolean> p;
|
||||
|
||||
@org.jetbrains.annotations.Nullable()
|
||||
public final kotlin.jvm.functions.Function0<java.lang.Boolean> getP();// getP()
|
||||
|
||||
public Foo(@org.jetbrains.annotations.Nullable() kotlin.jvm.functions.Function0<java.lang.Boolean>);// .ctor(kotlin.jvm.functions.Function0<java.lang.Boolean>)
|
||||
}
|
||||
|
||||
public abstract interface Test /* Test*/ {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public abstract A foo();// foo()
|
||||
|
||||
+6
@@ -6,6 +6,8 @@ typealias OtherA = A
|
||||
typealias OtherOtherA = OtherA
|
||||
typealias OtherB<X, Y> = B<Y, X>
|
||||
|
||||
typealias TA = () -> Boolean
|
||||
|
||||
interface Test {
|
||||
fun foo(): A
|
||||
fun fooAliased(): OtherA
|
||||
@@ -13,3 +15,7 @@ interface Test {
|
||||
fun bar(): B<A, B<A, String>>
|
||||
fun barAliased(): OtherB<OtherB<String, OtherA>, OtherOtherA>
|
||||
}
|
||||
|
||||
class Foo(
|
||||
val p: TA?,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user