mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-10 00:21:35 +00:00
If the delegated property operators involved are inline, and delegated property metadata parameter is not used (which is often the case, e.g., 'lazy'), we can skip those properties in metadata generation. NOT implemented: special case when only 'kProperty.name' is used by the corresponding delegated property operators. Also a sneak fix for KT-34060.
22 lines
512 B
Kotlin
Vendored
22 lines
512 B
Kotlin
Vendored
// IGNORE_BACKEND: JVM_IR
|
|
// WITH_RUNTIME
|
|
|
|
val topLevelLazyVal by lazy { 1 }
|
|
|
|
class C {
|
|
val memberLazyVal by lazy { 2 }
|
|
}
|
|
|
|
fun box(): String {
|
|
val localLazyVal by lazy { 3 }
|
|
|
|
if (topLevelLazyVal != 1) throw AssertionError()
|
|
if (C().memberLazyVal != 2) throw AssertionError()
|
|
if (localLazyVal != 3) throw AssertionError()
|
|
|
|
return "OK"
|
|
}
|
|
|
|
// 0 \$\$delegatedProperties
|
|
// 0 kotlin/jvm/internal/PropertyReference0Impl\.\<init\>
|
|
// 0 kotlin/jvm/internal/MutablePropertyReference0Impl\.\<init\> |