[FE] Refactoring: Move check for "enumConstructorsAreAlwaysCompatible" higher than check for callable kind
Review: https://jetbrains.team/p/kt/reviews/11039/timeline This is a preparation refactoring for the following KT-60902 fix and type-safety refactoring. This commit doesn't have observable side effects (and can be called pure refactoring) because the following conditions: 1. `expectDeclaration is ConstructorSymbolMarker && actualDeclaration is ConstructorSymbolMarker` 2. `expectDeclaration is FunctionSymbolMarker != actualDeclaration is FunctionSymbolMarker` can't be both `true` at the same time
This commit is contained in:
+4
-4
@@ -288,10 +288,6 @@ object AbstractExpectActualCompatibilityChecker {
|
|||||||
"This function should be invoked only for declarations in the same kind of container (both members or both top level): $expectDeclaration, $actualDeclaration"
|
"This function should be invoked only for declarations in the same kind of container (both members or both top level): $expectDeclaration, $actualDeclaration"
|
||||||
}
|
}
|
||||||
|
|
||||||
if (expectDeclaration is FunctionSymbolMarker != actualDeclaration is FunctionSymbolMarker) {
|
|
||||||
return Incompatible.CallableKind
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
enumConstructorsAreAlwaysCompatible &&
|
enumConstructorsAreAlwaysCompatible &&
|
||||||
expectContainingClass?.classKind == ClassKind.ENUM_CLASS &&
|
expectContainingClass?.classKind == ClassKind.ENUM_CLASS &&
|
||||||
@@ -302,6 +298,10 @@ object AbstractExpectActualCompatibilityChecker {
|
|||||||
return ExpectActualCompatibility.Compatible
|
return ExpectActualCompatibility.Compatible
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (expectDeclaration is FunctionSymbolMarker != actualDeclaration is FunctionSymbolMarker) {
|
||||||
|
return Incompatible.CallableKind
|
||||||
|
}
|
||||||
|
|
||||||
val expectedReceiverType = expectDeclaration.extensionReceiverType
|
val expectedReceiverType = expectDeclaration.extensionReceiverType
|
||||||
val actualReceiverType = actualDeclaration.extensionReceiverType
|
val actualReceiverType = actualDeclaration.extensionReceiverType
|
||||||
if ((expectedReceiverType != null) != (actualReceiverType != null)) {
|
if ((expectedReceiverType != null) != (actualReceiverType != null)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user