[Header mode] Skip eliding inline property getters/setters. ^KT-78422
diff --git a/compiler/fir/analysis-tests/testData/resolve/headerMode/propertyDeclaration.fir.txt b/compiler/fir/analysis-tests/testData/resolve/headerMode/propertyDeclaration.fir.txt index 28d3311..314c1f4 100644 --- a/compiler/fir/analysis-tests/testData/resolve/headerMode/propertyDeclaration.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/headerMode/propertyDeclaration.fir.txt
@@ -42,3 +42,11 @@ public get(): R|(kotlin/String) -> kotlin/String| public final val l: R|(kotlin/String) -> kotlin/String| public get(): R|(kotlin/String) -> kotlin/String| + public final val m: R|kotlin/String| + public inline get(): R|kotlin/String| { + ^ String(M) + } + public final val n: R|kotlin/String| + public inline get(): R|kotlin/String| { + ^ String(N) + }
diff --git a/compiler/fir/analysis-tests/testData/resolve/headerMode/propertyDeclaration.kt b/compiler/fir/analysis-tests/testData/resolve/headerMode/propertyDeclaration.kt index 42fd7b9..3f481a2 100644 --- a/compiler/fir/analysis-tests/testData/resolve/headerMode/propertyDeclaration.kt +++ b/compiler/fir/analysis-tests/testData/resolve/headerMode/propertyDeclaration.kt
@@ -37,4 +37,8 @@ return "foo: $foo" } val l = fun(foo: String): String { return "Foo: $foo" } +inline val m: String + get() = "M" +val n: String + inline get() = "N" /* GENERATED_FIR_TAGS: propertyDeclaration, stringLiteral */
diff --git a/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/LightTreeRawFirDeclarationBuilder.kt b/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/LightTreeRawFirDeclarationBuilder.kt index d919755..27179bf 100644 --- a/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/LightTreeRawFirDeclarationBuilder.kt +++ b/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/LightTreeRawFirDeclarationBuilder.kt
@@ -1773,7 +1773,7 @@ valueParameters += firValueParameters } val allowLegacyContractDescription = outerContractDescription == null - val bodyWithContractDescription = withForcedLocalContext(forceKeepingTheBodyInHeaderMode = propertyTypeRef is FirImplicitTypeRef) { + val bodyWithContractDescription = withForcedLocalContext(forceKeepingTheBodyInHeaderMode = propertyTypeRef is FirImplicitTypeRef || status.isInline) { convertFunctionBody(block, expression, allowLegacyContractDescription) } this.body = bodyWithContractDescription.first
diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt index ebed6d3..8065595 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt
@@ -728,8 +728,8 @@ session.languageVersionSettings.getFlag(AnalysisFlags.headerMode) && !this.isLocal && !this.isInline ) { - getter?.replaceBody(newBody = null) - setter?.replaceBody(newBody = null) + if (getter?.isInline == false) getter?.replaceBody(newBody = null) + if (setter?.isInline == false) setter?.replaceBody(newBody = null) } }