[Expect/Actual] Add ability to skip matching of constructors of expect enums
In terms of MPP there are no such thing as `expect constructor` for enums, but they are physically exist in FIR and IR, so we need a switch which skips matching for them FE 1.0 implementation did not touch to avoid any hidden changes
This commit is contained in:
committed by
Space Team
parent
ba41e8ec38
commit
8b9079d026
+10
@@ -256,6 +256,16 @@ object AbstractExpectActualCompatibilityChecker {
|
||||
return Incompatible.CallableKind
|
||||
}
|
||||
|
||||
if (
|
||||
enumConstructorsAreAlwaysCompatible &&
|
||||
expectContainingClass?.classKind == ClassKind.ENUM_CLASS &&
|
||||
actualContainingClass?.classKind == ClassKind.ENUM_CLASS &&
|
||||
expectDeclaration is ConstructorSymbolMarker &&
|
||||
actualDeclaration is ConstructorSymbolMarker
|
||||
) {
|
||||
return ExpectActualCompatibility.Compatible
|
||||
}
|
||||
|
||||
val expectedReceiverType = expectDeclaration.extensionReceiverType
|
||||
val actualReceiverType = actualDeclaration.extensionReceiverType
|
||||
if ((expectedReceiverType != null) != (actualReceiverType != null)) {
|
||||
|
||||
+3
@@ -36,6 +36,9 @@ interface ExpectActualMatchingContext<T : DeclarationSymbolMarker> : TypeSystemC
|
||||
val innerClassesCapturesOuterTypeParameters: Boolean
|
||||
get() = true
|
||||
|
||||
val enumConstructorsAreAlwaysCompatible: Boolean
|
||||
get() = false
|
||||
|
||||
val RegularClassSymbolMarker.classId: ClassId
|
||||
val TypeAliasSymbolMarker.classId: ClassId
|
||||
val CallableSymbolMarker.callableId: CallableId
|
||||
|
||||
Reference in New Issue
Block a user