JVM IR: do not generate InlineOnly property accessors in multifile facade
#KT-37007 Fixed
This commit is contained in:
+8
-7
@@ -143,13 +143,14 @@ private fun generateMultifileFacades(
|
||||
moveFieldsOfConstProperties(partClass, facadeClass)
|
||||
|
||||
for (member in partClass.declarations) {
|
||||
if (member is IrSimpleFunction &&
|
||||
!member.hasAnnotation(INLINE_ONLY_ANNOTATION_FQ_NAME)
|
||||
) {
|
||||
val newMember = member.createMultifileDelegateIfNeeded(context, facadeClass, shouldGeneratePartHierarchy)
|
||||
if (newMember != null) {
|
||||
functionDelegates[member] = newMember
|
||||
}
|
||||
if (member !is IrSimpleFunction) continue
|
||||
if (member.hasAnnotation(INLINE_ONLY_ANNOTATION_FQ_NAME) ||
|
||||
member.correspondingPropertySymbol?.owner?.hasAnnotation(INLINE_ONLY_ANNOTATION_FQ_NAME) == true
|
||||
) continue
|
||||
|
||||
val newMember = member.createMultifileDelegateIfNeeded(context, facadeClass, shouldGeneratePartHierarchy)
|
||||
if (newMember != null) {
|
||||
functionDelegates[member] = newMember
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+6
-2
@@ -1,5 +1,3 @@
|
||||
// !LANGUAGE: +UseGetterNameForPropertyAnnotationsMethodOnJvm
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// WITH_RUNTIME
|
||||
|
||||
@file:[JvmName("Foo") JvmMultifileClass]
|
||||
@@ -16,3 +14,9 @@ fun foo() {
|
||||
inline var prop: String
|
||||
get() = "12"
|
||||
set(value) {}
|
||||
|
||||
inline var prop2: String
|
||||
get() = "12"
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
@kotlin.internal.InlineOnly
|
||||
set(value) {}
|
||||
|
||||
+3
@@ -2,6 +2,7 @@
|
||||
public final class test/Foo {
|
||||
// source: 'InlineOnlyPropertyMultifile.kt'
|
||||
public final static method foo(): void
|
||||
public final static @org.jetbrains.annotations.NotNull method getProp2(): java.lang.String
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
@@ -10,5 +11,7 @@ synthetic final class test/Foo__InlineOnlyPropertyMultifileKt {
|
||||
public final static method foo(): void
|
||||
public synthetic deprecated static @kotlin.internal.InlineOnly method getProp$annotations(): void
|
||||
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 @kotlin.internal.InlineOnly method setProp2(p0: java.lang.String): void
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user