mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 08:31:26 +00:00
Fix for KT-14162: Support @InlineOnly on inline properties
#KT-14162 Fixed
This commit is contained in:
@@ -5,8 +5,13 @@ package test
|
||||
|
||||
fun foo() {
|
||||
inlineOnly<String>()
|
||||
inlineOnlyAnnotated()
|
||||
}
|
||||
|
||||
// No method should be generated in multifile facade for 'inlineOnly'
|
||||
// Because 'inlineOnly' is private in file part (because it's inline-only) and can't be delegated from facade
|
||||
public inline fun <reified T> inlineOnly() {}
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
@kotlin.internal.InlineOnly
|
||||
inline fun inlineOnlyAnnotated() { }
|
||||
|
||||
@@ -7,4 +7,5 @@ public final class test/Foo {
|
||||
synthetic final class test/Foo__InlineOnlyMultifileKt {
|
||||
public final static method foo(): void
|
||||
private final static method inlineOnly(): void
|
||||
}
|
||||
private final static @kotlin.internal.InlineOnly method inlineOnlyAnnotated(): void
|
||||
}
|
||||
|
||||
20
compiler/testData/codegen/bytecodeListing/InlineOnlyPropertyMultifile.kt
vendored
Normal file
20
compiler/testData/codegen/bytecodeListing/InlineOnlyPropertyMultifile.kt
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
@file:[JvmName("Foo") JvmMultifileClass]
|
||||
package test
|
||||
|
||||
fun foo() {
|
||||
prop
|
||||
"".extProp
|
||||
}
|
||||
|
||||
// No method should be generated in multifile facade for 'inlineOnly'
|
||||
// Because 'inlineOnly' is private in file part (because it's inline-only) and can't be delegated from facade
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
@kotlin.internal.InlineOnly
|
||||
inline var prop: String
|
||||
get() = "12"
|
||||
set(value) {}
|
||||
|
||||
inline val <reified Z> Z.extProp: String
|
||||
get() = "123"
|
||||
13
compiler/testData/codegen/bytecodeListing/InlineOnlyPropertyMultifile.txt
vendored
Normal file
13
compiler/testData/codegen/bytecodeListing/InlineOnlyPropertyMultifile.txt
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
@kotlin.Metadata
|
||||
public final class test/Foo {
|
||||
public final static method foo(): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
synthetic final class test/Foo__InlineOnlyPropertyMultifileKt {
|
||||
public final static method foo(): void
|
||||
private final static method getExtProp(p0: java.lang.Object): java.lang.String
|
||||
private final static method getProp(): java.lang.String
|
||||
private synthetic deprecated static @kotlin.internal.InlineOnly method prop$annotations(): void
|
||||
private final static method setProp(p0: java.lang.String): void
|
||||
}
|
||||
38
compiler/testData/codegen/bytecodeListing/inlineOnlyProperty.kt
vendored
Normal file
38
compiler/testData/codegen/bytecodeListing/inlineOnlyProperty.kt
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
|
||||
// WITH_RUNTIME
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
@kotlin.internal.InlineOnly
|
||||
inline var prop: String
|
||||
get() = "12"
|
||||
set(value) {}
|
||||
|
||||
inline var prop2: String
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
@kotlin.internal.InlineOnly
|
||||
get() = "12"
|
||||
set(value) {}
|
||||
|
||||
|
||||
inline val <reified Z> Z.extProp: String
|
||||
get() = "123"
|
||||
|
||||
class Foo {
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
@kotlin.internal.InlineOnly
|
||||
inline var prop: String
|
||||
get() = "12"
|
||||
set(value) {}
|
||||
|
||||
inline var prop2: String
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
@kotlin.internal.InlineOnly
|
||||
get() = "12"
|
||||
set(value) {}
|
||||
|
||||
|
||||
inline val <reified Z> Z.extProp: String
|
||||
get() = "123"
|
||||
|
||||
}
|
||||
20
compiler/testData/codegen/bytecodeListing/inlineOnlyProperty.txt
vendored
Normal file
20
compiler/testData/codegen/bytecodeListing/inlineOnlyProperty.txt
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
@kotlin.Metadata
|
||||
public final class Foo {
|
||||
public method <init>(): void
|
||||
private final method getExtProp(p0: java.lang.Object): java.lang.String
|
||||
private final method getProp(): java.lang.String
|
||||
private final @kotlin.internal.InlineOnly method getProp2(): java.lang.String
|
||||
private synthetic deprecated static @kotlin.internal.InlineOnly method prop$annotations(): void
|
||||
private final method setProp(p0: java.lang.String): void
|
||||
public final method setProp2(@org.jetbrains.annotations.NotNull p0: java.lang.String): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class InlineOnlyPropertyKt {
|
||||
private final static method getExtProp(p0: java.lang.Object): java.lang.String
|
||||
private final static method getProp(): java.lang.String
|
||||
private final static @kotlin.internal.InlineOnly method getProp2(): java.lang.String
|
||||
private synthetic deprecated static @kotlin.internal.InlineOnly method prop$annotations(): void
|
||||
private final static method setProp(p0: java.lang.String): void
|
||||
public final static method setProp2(@org.jetbrains.annotations.NotNull p0: java.lang.String): void
|
||||
}
|
||||
Reference in New Issue
Block a user