From ca74ad2ea0e1c193d36a0c9958be3f029af12fa7 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Thu, 12 Dec 2024 11:12:56 +0100 Subject: [PATCH] K2: drop redundant ExpectActualMatchingContext.isInline Related to KT-73785 --- .../transformers/mpp/FirExpectActualMatchingContextImpl.kt | 6 ++---- .../common/actualizer/IrExpectActualMatchingContext.kt | 4 +--- .../kotlin/resolve/calls/mpp/AbstractExpectActualChecker.kt | 2 +- .../kotlin/resolve/calls/mpp/ExpectActualMatchingContext.kt | 3 +-- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/mpp/FirExpectActualMatchingContextImpl.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/mpp/FirExpectActualMatchingContextImpl.kt index 86f5997cd135e..797e34ad9c20c 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/mpp/FirExpectActualMatchingContextImpl.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/mpp/FirExpectActualMatchingContextImpl.kt @@ -90,10 +90,8 @@ class FirExpectActualMatchingContextImpl private constructor( get() = asSymbol().resolvedStatus.isCompanion override val RegularClassSymbolMarker.isInner: Boolean get() = asSymbol().resolvedStatus.isInner - override val RegularClassSymbolMarker.isInline: Boolean - get() = asSymbol().resolvedStatus.isInline - override val RegularClassSymbolMarker.isValue: Boolean - get() = asSymbol().resolvedStatus.isValue + override val RegularClassSymbolMarker.isInlineOrValue: Boolean + get() = asSymbol().resolvedStatus.let { it.isInline || it.isValue } override val RegularClassSymbolMarker.isFun: Boolean get() = asSymbol().resolvedStatus.isFun diff --git a/compiler/ir/ir.actualization/src/main/kotlin/org/jetbrains/kotlin/backend/common/actualizer/IrExpectActualMatchingContext.kt b/compiler/ir/ir.actualization/src/main/kotlin/org/jetbrains/kotlin/backend/common/actualizer/IrExpectActualMatchingContext.kt index 04287611475c6..ee4f848b4fb44 100644 --- a/compiler/ir/ir.actualization/src/main/kotlin/org/jetbrains/kotlin/backend/common/actualizer/IrExpectActualMatchingContext.kt +++ b/compiler/ir/ir.actualization/src/main/kotlin/org/jetbrains/kotlin/backend/common/actualizer/IrExpectActualMatchingContext.kt @@ -119,9 +119,7 @@ internal abstract class IrExpectActualMatchingContext( get() = asIr().isCompanion override val RegularClassSymbolMarker.isInner: Boolean get() = asIr().isInner - override val RegularClassSymbolMarker.isInline: Boolean - get() = asIr().isValue - override val RegularClassSymbolMarker.isValue: Boolean + override val RegularClassSymbolMarker.isInlineOrValue: Boolean get() = asIr().isValue override val RegularClassSymbolMarker.isFun: Boolean diff --git a/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/mpp/AbstractExpectActualChecker.kt b/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/mpp/AbstractExpectActualChecker.kt index 7fc1d5f507af0..51121cf7b70c2 100644 --- a/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/mpp/AbstractExpectActualChecker.kt +++ b/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/mpp/AbstractExpectActualChecker.kt @@ -115,7 +115,7 @@ object AbstractExpectActualChecker { if (!areCompatibleClassKinds(expectClassSymbol, actualClass)) return ExpectActualCheckingCompatibility.ClassKind - if (!equalBy(expectClassSymbol, actualClass) { listOf(it.isCompanion, it.isInner, it.isInline || it.isValue) }) { + if (!equalBy(expectClassSymbol, actualClass) { listOf(it.isCompanion, it.isInner, it.isInlineOrValue) }) { return ExpectActualCheckingCompatibility.ClassModifiers } diff --git a/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/mpp/ExpectActualMatchingContext.kt b/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/mpp/ExpectActualMatchingContext.kt index 9d7954d1a31fe..372b8f74642df 100644 --- a/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/mpp/ExpectActualMatchingContext.kt +++ b/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/mpp/ExpectActualMatchingContext.kt @@ -50,8 +50,7 @@ interface ExpectActualMatchingContext : TypeSystemC val RegularClassSymbolMarker.isCompanion: Boolean val RegularClassSymbolMarker.isInner: Boolean - val RegularClassSymbolMarker.isInline: Boolean - val RegularClassSymbolMarker.isValue: Boolean + val RegularClassSymbolMarker.isInlineOrValue: Boolean val RegularClassSymbolMarker.isFun: Boolean val ClassLikeSymbolMarker.typeParameters: List