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,
|
||||
): FirResolvedTypeRef {
|
||||
val initialType = candidate.substitutor.substituteOrSelf(type)
|
||||
val finalType = finalSubstitutor.substituteOrNull(initialType)?.let { substitutedType ->
|
||||
typeApproximator.approximateToSuperType(
|
||||
substitutedType, TypeApproximatorConfiguration.FinalApproximationAfterResolutionAndInference,
|
||||
) as ConeKotlinType? ?: substitutedType
|
||||
}
|
||||
val substitutedType = finalSubstitutor.substituteOrNull(initialType)
|
||||
val finalType = typeApproximator.approximateToSuperType(
|
||||
type = substitutedType ?: initialType, TypeApproximatorConfiguration.FinalApproximationAfterResolutionAndInference,
|
||||
) as ConeKotlinType? ?: substitutedType
|
||||
|
||||
return withReplacedConeType(finalType)
|
||||
}
|
||||
|
||||
@@ -19,6 +19,6 @@ class In<in F> {
|
||||
}
|
||||
|
||||
fun test() {
|
||||
A.foo().x() checkType { _<Any?>() }
|
||||
A.bar().<!INAPPLICABLE_CANDIDATE!>y<!>(null)
|
||||
A.foo().<!UNRESOLVED_REFERENCE!>x<!>() <!INAPPLICABLE_CANDIDATE!>checkType<!> { _<Any?>() }
|
||||
A.bar().<!UNRESOLVED_REFERENCE!>y<!>(null)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user