JVM IR: do not generate InlineOnly property accessors in multifile facade

#KT-37007 Fixed
This commit is contained in:
Alexander Udalov
2020-11-04 21:14:54 +01:00
parent 500b1cfbd3
commit 55974b4eda
3 changed files with 17 additions and 9 deletions
@@ -143,13 +143,14 @@ private fun generateMultifileFacades(
moveFieldsOfConstProperties(partClass, facadeClass) moveFieldsOfConstProperties(partClass, facadeClass)
for (member in partClass.declarations) { for (member in partClass.declarations) {
if (member is IrSimpleFunction && if (member !is IrSimpleFunction) continue
!member.hasAnnotation(INLINE_ONLY_ANNOTATION_FQ_NAME) if (member.hasAnnotation(INLINE_ONLY_ANNOTATION_FQ_NAME) ||
) { member.correspondingPropertySymbol?.owner?.hasAnnotation(INLINE_ONLY_ANNOTATION_FQ_NAME) == true
val newMember = member.createMultifileDelegateIfNeeded(context, facadeClass, shouldGeneratePartHierarchy) ) continue
if (newMember != null) {
functionDelegates[member] = newMember val newMember = member.createMultifileDelegateIfNeeded(context, facadeClass, shouldGeneratePartHierarchy)
} if (newMember != null) {
functionDelegates[member] = newMember
} }
} }
} }
@@ -1,5 +1,3 @@
// !LANGUAGE: +UseGetterNameForPropertyAnnotationsMethodOnJvm
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME // WITH_RUNTIME
@file:[JvmName("Foo") JvmMultifileClass] @file:[JvmName("Foo") JvmMultifileClass]
@@ -16,3 +14,9 @@ fun foo() {
inline var prop: String inline var prop: String
get() = "12" get() = "12"
set(value) {} set(value) {}
inline var prop2: String
get() = "12"
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
@kotlin.internal.InlineOnly
set(value) {}
@@ -2,6 +2,7 @@
public final class test/Foo { public final class test/Foo {
// source: 'InlineOnlyPropertyMultifile.kt' // source: 'InlineOnlyPropertyMultifile.kt'
public final static method foo(): void public final static method foo(): void
public final static @org.jetbrains.annotations.NotNull method getProp2(): java.lang.String
} }
@kotlin.Metadata @kotlin.Metadata
@@ -10,5 +11,7 @@ synthetic final class test/Foo__InlineOnlyPropertyMultifileKt {
public final static method foo(): void public final static method foo(): void
public synthetic deprecated static @kotlin.internal.InlineOnly method getProp$annotations(): void public synthetic deprecated static @kotlin.internal.InlineOnly method getProp$annotations(): void
private final static method getProp(): java.lang.String private final static method getProp(): java.lang.String
public final static @org.jetbrains.annotations.NotNull method getProp2(): java.lang.String
private final static method setProp(p0: java.lang.String): void private final static method setProp(p0: java.lang.String): void
private final static @kotlin.internal.InlineOnly method setProp2(p0: java.lang.String): void
} }