[FIR] 2/2 Cleanup: drop no longer necessary FirActualCallableDeclarationChecker
It became possible to drop it after KT-62590. Now, on a frontend, the return type check is part of a common AbstractExpectActualChecker logic Change in nestedAnnotationClassViaActualTypealias.fir.kt aligns the behaviour with K1. KT-61964 Review: https://jetbrains.team/p/kt/reviews/12750/timeline
This commit is contained in:
+13
-15
@@ -362,22 +362,20 @@ object AbstractExpectActualChecker {
|
||||
val expectedValueParameters = expectDeclaration.valueParameters
|
||||
val actualValueParameters = actualDeclaration.valueParameters
|
||||
|
||||
if (shouldCheckReturnTypesOfCallables) {
|
||||
val substitutor = createExpectActualTypeParameterSubstitutor(
|
||||
(expectedTypeParameters zipIfSizesAreEqual actualTypeParameters)
|
||||
?: error("expect/actual type parameters sizes are checked earlier"),
|
||||
parentSubstitutor
|
||||
)
|
||||
val substitutor = createExpectActualTypeParameterSubstitutor(
|
||||
(expectedTypeParameters zipIfSizesAreEqual actualTypeParameters)
|
||||
?: error("expect/actual type parameters sizes are checked earlier"),
|
||||
parentSubstitutor
|
||||
)
|
||||
|
||||
if (!areCompatibleExpectActualTypes(
|
||||
substitutor.safeSubstitute(expectDeclaration.returnType),
|
||||
actualDeclaration.returnType,
|
||||
parameterOfAnnotationComparisonMode = insideAnnotationClass,
|
||||
dynamicTypesEqualToAnything = false
|
||||
)
|
||||
) {
|
||||
return ExpectActualCheckingCompatibility.ReturnType
|
||||
}
|
||||
if (!areCompatibleExpectActualTypes(
|
||||
substitutor.safeSubstitute(expectDeclaration.returnType),
|
||||
actualDeclaration.returnType,
|
||||
parameterOfAnnotationComparisonMode = insideAnnotationClass,
|
||||
dynamicTypesEqualToAnything = false
|
||||
)
|
||||
) {
|
||||
return ExpectActualCheckingCompatibility.ReturnType
|
||||
}
|
||||
|
||||
if (actualDeclaration.hasStableParameterNames && !equalsBy(expectedValueParameters, actualValueParameters) { it.name }) {
|
||||
|
||||
-2
@@ -20,8 +20,6 @@ import org.jetbrains.kotlin.types.model.TypeSubstitutorMarker
|
||||
import org.jetbrains.kotlin.types.model.TypeSystemContext
|
||||
|
||||
interface ExpectActualMatchingContext<T : DeclarationSymbolMarker> : TypeSystemContext {
|
||||
val shouldCheckReturnTypesOfCallables: Boolean
|
||||
|
||||
/*
|
||||
* This flag indicates how are type parameters of inner classes stored in the specific implementation of RegularClassSymbolMarker
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user