[IR] Use common expect/actual matching algorithm in IR actualizer
^KT-58578 Fixed
This commit is contained in:
committed by
Space Team
parent
62534f43c9
commit
ba41e8ec38
@@ -17,6 +17,8 @@ interface ConstructorSymbolMarker : FunctionSymbolMarker
|
||||
interface SimpleFunctionSymbolMarker : FunctionSymbolMarker
|
||||
interface PropertySymbolMarker : CallableSymbolMarker
|
||||
interface ValueParameterSymbolMarker : CallableSymbolMarker
|
||||
interface FieldSymbolMarker : CallableSymbolMarker
|
||||
interface EnumEntrySymbolMarker : CallableSymbolMarker
|
||||
|
||||
interface ClassifierSymbolMarker : DeclarationSymbolMarker
|
||||
interface TypeParameterSymbolMarker : ClassifierSymbolMarker
|
||||
|
||||
+11
@@ -5,6 +5,9 @@
|
||||
|
||||
package org.jetbrains.kotlin.resolve.multiplatform
|
||||
|
||||
import kotlin.contracts.ExperimentalContracts
|
||||
import kotlin.contracts.contract
|
||||
|
||||
sealed class ExpectActualCompatibility<out D> {
|
||||
// For IncompatibilityKind.STRONG `actual` declaration is considered as overload and error reports on expected declaration
|
||||
enum class IncompatibilityKind {
|
||||
@@ -95,3 +98,11 @@ sealed class ExpectActualCompatibility<out D> {
|
||||
|
||||
val ExpectActualCompatibility<*>.compatible: Boolean
|
||||
get() = this == ExpectActualCompatibility.Compatible
|
||||
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
fun ExpectActualCompatibility<*>.isIncompatible(): Boolean {
|
||||
contract {
|
||||
returns(true) implies (this@isIncompatible is ExpectActualCompatibility.Incompatible<*>)
|
||||
}
|
||||
return !compatible
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user