Add ClassDescriptor.getInlineClassRepresentation
This will be used at least in the JVM backend instead of the current approach where we're loading the primary constructor's first parameter, which isn't good enough since primary constructor can be private, and we can't rely on private declarations in case they're declared in another module.
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
// WITH_RUNTIME
|
||||
// MODULE: lib
|
||||
// FILE: A.kt
|
||||
|
||||
inline class A(val value: String) {
|
||||
val Char.value: String get() = this + nonExtensionValue()
|
||||
|
||||
fun nonExtensionValue(): String = value
|
||||
}
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: B.kt
|
||||
|
||||
fun box(): String = with(A("K")) { 'O'.value }
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// WITH_RUNTIME
|
||||
// MODULE: lib
|
||||
// USE_OLD_INLINE_CLASSES_MANGLING_SCHEME
|
||||
// FILE: A.kt
|
||||
|
||||
inline class A(val value: String) {
|
||||
val Char.value: String get() = this + nonExtensionValue()
|
||||
|
||||
fun nonExtensionValue(): String = value
|
||||
}
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: B.kt
|
||||
|
||||
fun box(): String = with(A("K")) { 'O'.value }
|
||||
Reference in New Issue
Block a user