diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/genericBackingFieldSignature.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/genericBackingFieldSignature.kt index 83db5f3f65f..b033b3ca478 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/genericBackingFieldSignature.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/genericBackingFieldSignature.kt @@ -28,7 +28,9 @@ class Test(val constructorProperty: T) { val classField4 : Zin? = null - val delegates : Z? by Delegates.lazy {Z()} + val delegateLazy: Z? by lazy {Z()} + + val delegateNotNull: Z? by Delegates.notNull() } @@ -65,11 +67,16 @@ fun box(): String { if (classField4.getGenericType().toString() != "Zin") return "fail4:" + classField4.getGenericType(); - val classField5 = clz.getDeclaredField("delegates\$delegate"); + val classField5 = clz.getDeclaredField("delegateLazy\$delegate"); - if (classField5.getGenericType().toString() != "kotlin.properties.ReadOnlyProperty>") + if (classField5.getGenericType().toString() != "kotlin.Lazy>") return "fail5:" + classField5.getGenericType(); + val classField6 = clz.getDeclaredField("delegateNotNull\$delegate"); + + if (classField6.getGenericType().toString() != "kotlin.properties.ReadWriteProperty>") + return "fail6:" + classField6.getGenericType(); + return "OK" } diff --git a/compiler/testData/codegen/boxWithStdlib/reflection/enclosing/kt6368.kt b/compiler/testData/codegen/boxWithStdlib/reflection/enclosing/kt6368.kt index 8547b6a5178..768c41c5d60 100644 --- a/compiler/testData/codegen/boxWithStdlib/reflection/enclosing/kt6368.kt +++ b/compiler/testData/codegen/boxWithStdlib/reflection/enclosing/kt6368.kt @@ -1,11 +1,10 @@ -import kotlin.properties.Delegates import java.util.HashMap interface R { fun result(): String } -val a by Delegates.lazy { +val a by lazy { with(HashMap()) { put("result", object : R { override fun result(): String = "OK" diff --git a/idea/testData/intentions/convertPropertyToFunction/delegatingProperty.kt b/idea/testData/intentions/convertPropertyToFunction/delegatingProperty.kt index c6610c862a4..0b6878d6f0e 100644 --- a/idea/testData/intentions/convertPropertyToFunction/delegatingProperty.kt +++ b/idea/testData/intentions/convertPropertyToFunction/delegatingProperty.kt @@ -1,9 +1,8 @@ // WITH_RUNTIME // IS_APPLICABLE: false -import kotlin.properties.Delegates class A(val n: Int) { - val foo: Boolean by Delegates.lazy { n > 1 } + val foo: Boolean by lazy { n > 1 } } fun test() { diff --git a/idea/testData/resolve/references/delegatedPropertyAccessors/inStandardLibrary/lazy.kt b/idea/testData/resolve/references/delegatedPropertyAccessors/inStandardLibrary/lazy.kt index 32f35186007..c8e9b6fb57c 100644 --- a/idea/testData/resolve/references/delegatedPropertyAccessors/inStandardLibrary/lazy.kt +++ b/idea/testData/resolve/references/delegatedPropertyAccessors/inStandardLibrary/lazy.kt @@ -1,5 +1,3 @@ -import kotlin.properties.Delegates +val x: Int by lazy {1} -val x: Int by Delegates.lazy {1} - -// REF: (in kotlin.properties.ReadOnlyProperty).getValue(R,kotlin.reflect.KProperty<*>) +// REF: (for kotlin.Lazy in kotlin).getValue(kotlin.Any?,kotlin.reflect.KProperty<*>)