FIR: perform more proper type approximation in completion
Note: test data change is questionable here
This commit is contained in:
+4
-5
@@ -260,11 +260,10 @@ class FirCallCompletionResultsWriterTransformer(
|
|||||||
candidate: Candidate,
|
candidate: Candidate,
|
||||||
): FirResolvedTypeRef {
|
): FirResolvedTypeRef {
|
||||||
val initialType = candidate.substitutor.substituteOrSelf(type)
|
val initialType = candidate.substitutor.substituteOrSelf(type)
|
||||||
val finalType = finalSubstitutor.substituteOrNull(initialType)?.let { substitutedType ->
|
val substitutedType = finalSubstitutor.substituteOrNull(initialType)
|
||||||
typeApproximator.approximateToSuperType(
|
val finalType = typeApproximator.approximateToSuperType(
|
||||||
substitutedType, TypeApproximatorConfiguration.FinalApproximationAfterResolutionAndInference,
|
type = substitutedType ?: initialType, TypeApproximatorConfiguration.FinalApproximationAfterResolutionAndInference,
|
||||||
) as ConeKotlinType? ?: substitutedType
|
) as ConeKotlinType? ?: substitutedType
|
||||||
}
|
|
||||||
|
|
||||||
return withReplacedConeType(finalType)
|
return withReplacedConeType(finalType)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,6 @@ class In<in F> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun test() {
|
fun test() {
|
||||||
A.foo().x() checkType { _<Any?>() }
|
A.foo().<!UNRESOLVED_REFERENCE!>x<!>() <!INAPPLICABLE_CANDIDATE!>checkType<!> { _<Any?>() }
|
||||||
A.bar().<!INAPPLICABLE_CANDIDATE!>y<!>(null)
|
A.bar().<!UNRESOLVED_REFERENCE!>y<!>(null)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user