From 9cef8a2133f7caca30dffdd8e5fa5917b9e1768b Mon Sep 17 00:00:00 2001 From: "Evgeniy.Zhelenskiy" Date: Fri, 8 Dec 2023 13:18:59 +0000 Subject: [PATCH] [FIR, Tests] Add box tests to verify that disappeared DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE leads to executable code #KT-59903 Merge-request: KT-MR-13423 Merged-by: Evgeniy Zhelenskiy --- ...LFirBlackBoxCodegenBasedTestGenerated.java | 30 ++++++++++ ...rsedBlackBoxCodegenBasedTestGenerated.java | 30 ++++++++++ ...LightTreeBlackBoxCodegenTestGenerated.java | 30 ++++++++++ ...hIrFakeOverrideGeneratorTestGenerated.java | 30 ++++++++++ .../FirPsiBlackBoxCodegenTestGenerated.java | 30 ++++++++++ .../provideDelegate/commonCaseForInference.kt | 20 +++++++ .../provideDelegate/inferenceFromReceiver2.kt | 19 +++++++ .../notNullAssertionInLocalDelegated.fir.txt | 42 ++++++++++++++ .../notNullAssertionInLocalDelegated.kt | 33 +++++++++++ .../provideDelegate/setValue.kt | 40 ++++++++++++++ .../ifWithCallableReferenceInLazy.kt | 55 +++++++++++++++++++ .../codegen/BlackBoxCodegenTestGenerated.java | 30 ++++++++++ .../IrBlackBoxCodegenTestGenerated.java | 30 ++++++++++ ...kBoxCodegenWithIrInlinerTestGenerated.java | 30 ++++++++++ .../LightAnalysisModeTestGenerated.java | 25 +++++++++ .../fir/FirJsCodegenBoxTestGenerated.java | 30 ++++++++++ .../fir/FirJsES6CodegenBoxTestGenerated.java | 30 ++++++++++ .../test/ir/IrJsCodegenBoxTestGenerated.java | 30 ++++++++++ .../ir/IrJsES6CodegenBoxTestGenerated.java | 30 ++++++++++ .../FirNativeCodegenBoxTestGenerated.java | 30 ++++++++++ .../FirNativeCodegenBoxTestNoPLGenerated.java | 30 ++++++++++ .../NativeCodegenBoxTestGenerated.java | 30 ++++++++++ .../NativeCodegenBoxTestNoPLGenerated.java | 30 ++++++++++ .../test/FirWasmCodegenBoxTestGenerated.java | 30 ++++++++++ .../test/K1WasmCodegenBoxTestGenerated.java | 30 ++++++++++ 25 files changed, 774 insertions(+) create mode 100644 compiler/testData/codegen/box/delegatedProperty/provideDelegate/commonCaseForInference.kt create mode 100644 compiler/testData/codegen/box/delegatedProperty/provideDelegate/inferenceFromReceiver2.kt create mode 100644 compiler/testData/codegen/box/delegatedProperty/provideDelegate/notNullAssertionInLocalDelegated.fir.txt create mode 100644 compiler/testData/codegen/box/delegatedProperty/provideDelegate/notNullAssertionInLocalDelegated.kt create mode 100644 compiler/testData/codegen/box/delegatedProperty/provideDelegate/setValue.kt create mode 100644 compiler/testData/codegen/box/delegation/ifWithCallableReferenceInLazy.kt diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java index 5fe6a72df97..9aad3c8b66f 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java @@ -16527,6 +16527,12 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/delegatedProperty/provideDelegate"), Pattern.compile("^(.+)\\.kt$"), null, true); } + @Test + @TestMetadata("commonCaseForInference.kt") + public void testCommonCaseForInference() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/commonCaseForInference.kt"); + } + @Test @TestMetadata("delegatedPropertyWithIdProvideDelegate.kt") public void testDelegatedPropertyWithIdProvideDelegate() throws Exception { @@ -16587,6 +16593,12 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inClass.kt"); } + @Test + @TestMetadata("inferenceFromReceiver2.kt") + public void testInferenceFromReceiver2() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inferenceFromReceiver2.kt"); + } + @Test @TestMetadata("inlineProvideDelegate.kt") public void testInlineProvideDelegate() throws Exception { @@ -16647,6 +16659,12 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/memberExtension.kt"); } + @Test + @TestMetadata("notNullAssertionInLocalDelegated.kt") + public void testNotNullAssertionInLocalDelegated() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/notNullAssertionInLocalDelegated.kt"); + } + @Test @TestMetadata("propertyMetadata.kt") public void testPropertyMetadata() throws Exception { @@ -16658,6 +16676,12 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo public void testProvideDelegateByExtensionFunction() throws Exception { runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/provideDelegateByExtensionFunction.kt"); } + + @Test + @TestMetadata("setValue.kt") + public void testSetValue() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/setValue.kt"); + } } } @@ -16772,6 +16796,12 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo runTest("compiler/testData/codegen/box/delegation/hiddenSuperOverrideIn1.0.kt"); } + @Test + @TestMetadata("ifWithCallableReferenceInLazy.kt") + public void testIfWithCallableReferenceInLazy() throws Exception { + runTest("compiler/testData/codegen/box/delegation/ifWithCallableReferenceInLazy.kt"); + } + @Test @TestMetadata("inClassDeclaration.kt") public void testInClassDeclaration() throws Exception { diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java index b8f040d673b..d6b4b364e61 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java @@ -16527,6 +16527,12 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/delegatedProperty/provideDelegate"), Pattern.compile("^(.+)\\.kt$"), null, true); } + @Test + @TestMetadata("commonCaseForInference.kt") + public void testCommonCaseForInference() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/commonCaseForInference.kt"); + } + @Test @TestMetadata("delegatedPropertyWithIdProvideDelegate.kt") public void testDelegatedPropertyWithIdProvideDelegate() throws Exception { @@ -16587,6 +16593,12 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inClass.kt"); } + @Test + @TestMetadata("inferenceFromReceiver2.kt") + public void testInferenceFromReceiver2() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inferenceFromReceiver2.kt"); + } + @Test @TestMetadata("inlineProvideDelegate.kt") public void testInlineProvideDelegate() throws Exception { @@ -16647,6 +16659,12 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/memberExtension.kt"); } + @Test + @TestMetadata("notNullAssertionInLocalDelegated.kt") + public void testNotNullAssertionInLocalDelegated() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/notNullAssertionInLocalDelegated.kt"); + } + @Test @TestMetadata("propertyMetadata.kt") public void testPropertyMetadata() throws Exception { @@ -16658,6 +16676,12 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi public void testProvideDelegateByExtensionFunction() throws Exception { runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/provideDelegateByExtensionFunction.kt"); } + + @Test + @TestMetadata("setValue.kt") + public void testSetValue() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/setValue.kt"); + } } } @@ -16772,6 +16796,12 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi runTest("compiler/testData/codegen/box/delegation/hiddenSuperOverrideIn1.0.kt"); } + @Test + @TestMetadata("ifWithCallableReferenceInLazy.kt") + public void testIfWithCallableReferenceInLazy() throws Exception { + runTest("compiler/testData/codegen/box/delegation/ifWithCallableReferenceInLazy.kt"); + } + @Test @TestMetadata("inClassDeclaration.kt") public void testInClassDeclaration() throws Exception { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java index 598c7755cf3..a8d381262d7 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java @@ -16468,6 +16468,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/delegatedProperty/provideDelegate"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test + @TestMetadata("commonCaseForInference.kt") + public void testCommonCaseForInference() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/commonCaseForInference.kt"); + } + @Test @TestMetadata("delegatedPropertyWithIdProvideDelegate.kt") public void testDelegatedPropertyWithIdProvideDelegate() throws Exception { @@ -16528,6 +16534,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inClass.kt"); } + @Test + @TestMetadata("inferenceFromReceiver2.kt") + public void testInferenceFromReceiver2() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inferenceFromReceiver2.kt"); + } + @Test @TestMetadata("inlineProvideDelegate.kt") public void testInlineProvideDelegate() throws Exception { @@ -16588,6 +16600,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/memberExtension.kt"); } + @Test + @TestMetadata("notNullAssertionInLocalDelegated.kt") + public void testNotNullAssertionInLocalDelegated() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/notNullAssertionInLocalDelegated.kt"); + } + @Test @TestMetadata("propertyMetadata.kt") public void testPropertyMetadata() throws Exception { @@ -16599,6 +16617,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr public void testProvideDelegateByExtensionFunction() throws Exception { runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/provideDelegateByExtensionFunction.kt"); } + + @Test + @TestMetadata("setValue.kt") + public void testSetValue() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/setValue.kt"); + } } } @@ -16713,6 +16737,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr runTest("compiler/testData/codegen/box/delegation/hiddenSuperOverrideIn1.0.kt"); } + @Test + @TestMetadata("ifWithCallableReferenceInLazy.kt") + public void testIfWithCallableReferenceInLazy() throws Exception { + runTest("compiler/testData/codegen/box/delegation/ifWithCallableReferenceInLazy.kt"); + } + @Test @TestMetadata("inClassDeclaration.kt") public void testInClassDeclaration() throws Exception { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated.java index d46523d8818..ab35175f12b 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated.java @@ -16468,6 +16468,12 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/delegatedProperty/provideDelegate"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test + @TestMetadata("commonCaseForInference.kt") + public void testCommonCaseForInference() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/commonCaseForInference.kt"); + } + @Test @TestMetadata("delegatedPropertyWithIdProvideDelegate.kt") public void testDelegatedPropertyWithIdProvideDelegate() throws Exception { @@ -16528,6 +16534,12 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inClass.kt"); } + @Test + @TestMetadata("inferenceFromReceiver2.kt") + public void testInferenceFromReceiver2() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inferenceFromReceiver2.kt"); + } + @Test @TestMetadata("inlineProvideDelegate.kt") public void testInlineProvideDelegate() throws Exception { @@ -16588,6 +16600,12 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/memberExtension.kt"); } + @Test + @TestMetadata("notNullAssertionInLocalDelegated.kt") + public void testNotNullAssertionInLocalDelegated() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/notNullAssertionInLocalDelegated.kt"); + } + @Test @TestMetadata("propertyMetadata.kt") public void testPropertyMetadata() throws Exception { @@ -16599,6 +16617,12 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated public void testProvideDelegateByExtensionFunction() throws Exception { runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/provideDelegateByExtensionFunction.kt"); } + + @Test + @TestMetadata("setValue.kt") + public void testSetValue() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/setValue.kt"); + } } } @@ -16713,6 +16737,12 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated runTest("compiler/testData/codegen/box/delegation/hiddenSuperOverrideIn1.0.kt"); } + @Test + @TestMetadata("ifWithCallableReferenceInLazy.kt") + public void testIfWithCallableReferenceInLazy() throws Exception { + runTest("compiler/testData/codegen/box/delegation/ifWithCallableReferenceInLazy.kt"); + } + @Test @TestMetadata("inClassDeclaration.kt") public void testInClassDeclaration() throws Exception { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java index 37c9821432d..d6f299d0d91 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java @@ -16468,6 +16468,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/delegatedProperty/provideDelegate"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test + @TestMetadata("commonCaseForInference.kt") + public void testCommonCaseForInference() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/commonCaseForInference.kt"); + } + @Test @TestMetadata("delegatedPropertyWithIdProvideDelegate.kt") public void testDelegatedPropertyWithIdProvideDelegate() throws Exception { @@ -16528,6 +16534,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inClass.kt"); } + @Test + @TestMetadata("inferenceFromReceiver2.kt") + public void testInferenceFromReceiver2() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inferenceFromReceiver2.kt"); + } + @Test @TestMetadata("inlineProvideDelegate.kt") public void testInlineProvideDelegate() throws Exception { @@ -16588,6 +16600,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/memberExtension.kt"); } + @Test + @TestMetadata("notNullAssertionInLocalDelegated.kt") + public void testNotNullAssertionInLocalDelegated() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/notNullAssertionInLocalDelegated.kt"); + } + @Test @TestMetadata("propertyMetadata.kt") public void testPropertyMetadata() throws Exception { @@ -16599,6 +16617,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo public void testProvideDelegateByExtensionFunction() throws Exception { runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/provideDelegateByExtensionFunction.kt"); } + + @Test + @TestMetadata("setValue.kt") + public void testSetValue() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/setValue.kt"); + } } } @@ -16713,6 +16737,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo runTest("compiler/testData/codegen/box/delegation/hiddenSuperOverrideIn1.0.kt"); } + @Test + @TestMetadata("ifWithCallableReferenceInLazy.kt") + public void testIfWithCallableReferenceInLazy() throws Exception { + runTest("compiler/testData/codegen/box/delegation/ifWithCallableReferenceInLazy.kt"); + } + @Test @TestMetadata("inClassDeclaration.kt") public void testInClassDeclaration() throws Exception { diff --git a/compiler/testData/codegen/box/delegatedProperty/provideDelegate/commonCaseForInference.kt b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/commonCaseForInference.kt new file mode 100644 index 00000000000..7ce9156a783 --- /dev/null +++ b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/commonCaseForInference.kt @@ -0,0 +1,20 @@ +// !DIAGNOSTICS: -UNUSED_PARAMETER +// IGNORE_BACKEND_K1: ANY +// WITH_STDLIB + +object CommonCase { + interface Fas + + fun delegate() : Fas = object : Fas {} + + operator fun Fas.provideDelegate(host: D, p: Any?): Fas = this + operator fun Fas.getValue(receiver: E, p: Any?): R = "OK" as R + + val Long.test1: String by delegate() + val Long.test2: String by delegate() +} + +fun box() = with(CommonCase) { + require(3L.test1 == "OK" && 3L.test2 == "OK") + "OK" +} diff --git a/compiler/testData/codegen/box/delegatedProperty/provideDelegate/inferenceFromReceiver2.kt b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/inferenceFromReceiver2.kt new file mode 100644 index 00000000000..0a3f7867c03 --- /dev/null +++ b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/inferenceFromReceiver2.kt @@ -0,0 +1,19 @@ +// IGNORE_BACKEND_K1: ANY +// WITH_STDLIB + +object Inference2 { + interface Foo + + fun delegate(): Foo = object : Foo {} + + operator fun Foo.provideDelegate(host: T, p: Any?): Foo = this + operator fun Foo.getValue(receiver: Inference2, p: Any?): String = "OK" + + val test1: String by delegate() // same story like in Inference1 + val test2: String by delegate() +} + +fun box(): String { + require(Inference2.test1 == "OK" && Inference2.test2 == "OK") + return "OK" +} diff --git a/compiler/testData/codegen/box/delegatedProperty/provideDelegate/notNullAssertionInLocalDelegated.fir.txt b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/notNullAssertionInLocalDelegated.fir.txt new file mode 100644 index 00000000000..caa389c941c --- /dev/null +++ b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/notNullAssertionInLocalDelegated.fir.txt @@ -0,0 +1,42 @@ +FILE: notNullAssertionInLocalDelegated.kt + public final data class Ref : R|kotlin/Any| { + public constructor(t: R|D|): R|Ref| { + super() + } + + public final val t: R|D| = R|/t| + public get(): R|D| + + public final operator fun component1(): R|D| + + public final fun copy(t: R|D| = this@R|/Ref|.R|/Ref.t|): R|Ref| + + } + public final class GenericDelegate : R|kotlin/Any| { + public constructor(value: R|G|): R|GenericDelegate| { + super() + } + + public final val value: R|G| = R|/value| + public get(): R|G| + + } + public final operator fun R|Ref|.provideDelegate(a: R|kotlin/Any?|, p: R|kotlin/reflect/KProperty<*>|): R|GenericDelegate| { + ^provideDelegate R|/GenericDelegate.GenericDelegate|(this@R|/provideDelegate|.R|SubstitutionOverride|) + } + public final operator fun R|GenericDelegate|.getValue(a: R|kotlin/Any?|, p: R|kotlin/reflect/KProperty<*>|): R|W| { + ^getValue this@R|/getValue|.R|SubstitutionOverride| + } + public final fun R|kotlin/collections/List>|.getElement(i: R|kotlin/Int|): R|Ref| { + ^getElement (this@R|/getElement|.R|SubstitutionOverride|>|(R|/i|) as R|Ref|) + } + @R|kotlin/Suppress|(names = vararg(String(UNNECESSARY_NOT_NULL_ASSERTION))) public final fun test(list: R|kotlin/collections/List>|): R|kotlin/Unit| { + lval data: R|kotlin/String|by R|/list|.R|/getElement|(Int(0))!!.R|/provideDelegate|(Null(null), ::R|/data|) + R|kotlin/require|(==(R|/data|, R|/list|.R|SubstitutionOverride|>|(Int(0)).R|SubstitutionOverride|)) + lval data2: R|kotlin/String|by R|/list|.R|/getElement|(Int(0)).R|/provideDelegate|(Null(null), ::R|/data2|) + R|kotlin/require|(==(R|/data2|, R|/list|.R|SubstitutionOverride|>|(Int(0)).R|SubstitutionOverride|)) + } + public final fun box(): R|kotlin/String| { + R|/test|(R|kotlin/collections/listOf||>(R|/Ref.Ref|(String(q)))) + ^box String(OK) + } diff --git a/compiler/testData/codegen/box/delegatedProperty/provideDelegate/notNullAssertionInLocalDelegated.kt b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/notNullAssertionInLocalDelegated.kt new file mode 100644 index 00000000000..4836b3a731b --- /dev/null +++ b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/notNullAssertionInLocalDelegated.kt @@ -0,0 +1,33 @@ +// ISSUE: KT-58013 +// WITH_STDLIB +// WITH_REFLECT +// FIR_DUMP +// IGNORE_BACKEND_K1: ANY + + +import kotlin.reflect.KProperty + +data class Ref(val t: D) + +class GenericDelegate(val value: G) + +operator fun Ref.provideDelegate(a: Any?, p: KProperty<*>): GenericDelegate = GenericDelegate(this.t) + +operator fun GenericDelegate.getValue(a: Any?, p: KProperty<*>): W = this.value + +fun List>.getElement(i: Int): Ref = this[i] as Ref + +@Suppress("UNNECESSARY_NOT_NULL_ASSERTION") +fun test(list: List>) { + val data: String by list.getElement(0)!! + require(data == list[0].t) + + val data2: String by list.getElement(0) + require(data2 == list[0].t) +} + +fun box(): String { + test(listOf(Ref("q"))) + + return "OK" +} diff --git a/compiler/testData/codegen/box/delegatedProperty/provideDelegate/setValue.kt b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/setValue.kt new file mode 100644 index 00000000000..4fdf95521dd --- /dev/null +++ b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/setValue.kt @@ -0,0 +1,40 @@ +// !DIAGNOSTICS: -UNUSED_PARAMETER +// ISSUE: KT-61077 +// IGNORE_BACKEND_K1: ANY +// WITH_STDLIB + +data class Delegate(val data: T) + +var counter = 0 + +operator fun Delegate<*>.getValue(receiver: Any?, p: Any): String = this.data.toString() +operator fun Delegate.setValue(receiver: Any?, p: Any, value: T) { + require(value == "OK") + counter++ +} + +operator fun String.provideDelegate(receiver: Any?, p: Any) = Delegate(this as T) + +var test1: String by Delegate("OK1") +var test2: String by Delegate("OK2") + +var test3: String by "OK3" + +var test4: String by "OK4".provideDelegate(null, "") +var test5: String by "OK5".provideDelegate(null, "") + +fun box(): String { + require(test1 == "OK1") + test1 = "OK" + require(test2 == "OK2") + test2 = "OK" + require(test3 == "OK3") + test3 = "OK" + require(test4 == "OK4") + test4 = "OK" + require(test5 == "OK5") + test5 = "OK" + require(counter == 5) { "Counter counter is $counter" } + + return "OK" +} diff --git a/compiler/testData/codegen/box/delegation/ifWithCallableReferenceInLazy.kt b/compiler/testData/codegen/box/delegation/ifWithCallableReferenceInLazy.kt new file mode 100644 index 00000000000..fbc712ff5b2 --- /dev/null +++ b/compiler/testData/codegen/box/delegation/ifWithCallableReferenceInLazy.kt @@ -0,0 +1,55 @@ +// ISSUE: KT-58754 +// IGNORE_BACKEND_K1: ANY +// WITH_STDLIB + + +fun foo(): Int = 1 +fun bar(): Int = 2 + +class Test(b: Boolean) { + val test_1 by lazy { + val a = if (b) { + ::foo + } else { + ::bar + } + a + } + + val test_2 by lazy { + val a = if (b) ::foo else ::bar + a + } + + val test_3 by lazy { + val a = when { + b -> { ::foo } + else -> { ::bar } + } + a + } + + val test_4 by lazy { + val a = when { + b -> ::foo + else -> ::bar + } + a + } +} + +fun box(): String { + with(Test(b = false)) { + require(test_1() == bar()) + require(test_2() == bar()) + require(test_3() == bar()) + require(test_4() == bar()) + } + with(Test(b = true)) { + require(test_1() == foo()) + require(test_2() == foo()) + require(test_3() == foo()) + require(test_4() == foo()) + } + return "OK" +} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index 159fb76388b..75d5329325e 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -16096,6 +16096,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/delegatedProperty/provideDelegate"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test + @TestMetadata("commonCaseForInference.kt") + public void testCommonCaseForInference() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/commonCaseForInference.kt"); + } + @Test @TestMetadata("delegatedPropertyWithIdProvideDelegate.kt") public void testDelegatedPropertyWithIdProvideDelegate() throws Exception { @@ -16156,6 +16162,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inClass.kt"); } + @Test + @TestMetadata("inferenceFromReceiver2.kt") + public void testInferenceFromReceiver2() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inferenceFromReceiver2.kt"); + } + @Test @TestMetadata("inlineProvideDelegate.kt") public void testInlineProvideDelegate() throws Exception { @@ -16216,6 +16228,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/memberExtension.kt"); } + @Test + @TestMetadata("notNullAssertionInLocalDelegated.kt") + public void testNotNullAssertionInLocalDelegated() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/notNullAssertionInLocalDelegated.kt"); + } + @Test @TestMetadata("propertyMetadata.kt") public void testPropertyMetadata() throws Exception { @@ -16227,6 +16245,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { public void testProvideDelegateByExtensionFunction() throws Exception { runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/provideDelegateByExtensionFunction.kt"); } + + @Test + @TestMetadata("setValue.kt") + public void testSetValue() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/setValue.kt"); + } } } @@ -16341,6 +16365,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/delegation/hiddenSuperOverrideIn1.0.kt"); } + @Test + @TestMetadata("ifWithCallableReferenceInLazy.kt") + public void testIfWithCallableReferenceInLazy() throws Exception { + runTest("compiler/testData/codegen/box/delegation/ifWithCallableReferenceInLazy.kt"); + } + @Test @TestMetadata("inClassDeclaration.kt") public void testInClassDeclaration() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index 4aa8db51ac8..316115ad5dc 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -16468,6 +16468,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/delegatedProperty/provideDelegate"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test + @TestMetadata("commonCaseForInference.kt") + public void testCommonCaseForInference() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/commonCaseForInference.kt"); + } + @Test @TestMetadata("delegatedPropertyWithIdProvideDelegate.kt") public void testDelegatedPropertyWithIdProvideDelegate() throws Exception { @@ -16528,6 +16534,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inClass.kt"); } + @Test + @TestMetadata("inferenceFromReceiver2.kt") + public void testInferenceFromReceiver2() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inferenceFromReceiver2.kt"); + } + @Test @TestMetadata("inlineProvideDelegate.kt") public void testInlineProvideDelegate() throws Exception { @@ -16588,6 +16600,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/memberExtension.kt"); } + @Test + @TestMetadata("notNullAssertionInLocalDelegated.kt") + public void testNotNullAssertionInLocalDelegated() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/notNullAssertionInLocalDelegated.kt"); + } + @Test @TestMetadata("propertyMetadata.kt") public void testPropertyMetadata() throws Exception { @@ -16599,6 +16617,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes public void testProvideDelegateByExtensionFunction() throws Exception { runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/provideDelegateByExtensionFunction.kt"); } + + @Test + @TestMetadata("setValue.kt") + public void testSetValue() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/setValue.kt"); + } } } @@ -16713,6 +16737,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/delegation/hiddenSuperOverrideIn1.0.kt"); } + @Test + @TestMetadata("ifWithCallableReferenceInLazy.kt") + public void testIfWithCallableReferenceInLazy() throws Exception { + runTest("compiler/testData/codegen/box/delegation/ifWithCallableReferenceInLazy.kt"); + } + @Test @TestMetadata("inClassDeclaration.kt") public void testInClassDeclaration() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java index 2831e8f2ecd..18e91723366 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java @@ -16468,6 +16468,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/delegatedProperty/provideDelegate"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test + @TestMetadata("commonCaseForInference.kt") + public void testCommonCaseForInference() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/commonCaseForInference.kt"); + } + @Test @TestMetadata("delegatedPropertyWithIdProvideDelegate.kt") public void testDelegatedPropertyWithIdProvideDelegate() throws Exception { @@ -16528,6 +16534,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inClass.kt"); } + @Test + @TestMetadata("inferenceFromReceiver2.kt") + public void testInferenceFromReceiver2() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inferenceFromReceiver2.kt"); + } + @Test @TestMetadata("inlineProvideDelegate.kt") public void testInlineProvideDelegate() throws Exception { @@ -16588,6 +16600,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/memberExtension.kt"); } + @Test + @TestMetadata("notNullAssertionInLocalDelegated.kt") + public void testNotNullAssertionInLocalDelegated() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/notNullAssertionInLocalDelegated.kt"); + } + @Test @TestMetadata("propertyMetadata.kt") public void testPropertyMetadata() throws Exception { @@ -16599,6 +16617,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack public void testProvideDelegateByExtensionFunction() throws Exception { runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/provideDelegateByExtensionFunction.kt"); } + + @Test + @TestMetadata("setValue.kt") + public void testSetValue() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/setValue.kt"); + } } } @@ -16713,6 +16737,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack runTest("compiler/testData/codegen/box/delegation/hiddenSuperOverrideIn1.0.kt"); } + @Test + @TestMetadata("ifWithCallableReferenceInLazy.kt") + public void testIfWithCallableReferenceInLazy() throws Exception { + runTest("compiler/testData/codegen/box/delegation/ifWithCallableReferenceInLazy.kt"); + } + @Test @TestMetadata("inClassDeclaration.kt") public void testInClassDeclaration() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 3b7da5aedcb..aca4c7a4e53 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -13575,6 +13575,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/delegatedProperty/provideDelegate"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @TestMetadata("commonCaseForInference.kt") + public void testCommonCaseForInference() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/commonCaseForInference.kt"); + } + @TestMetadata("delegatedPropertyWithIdProvideDelegate.kt") public void testDelegatedPropertyWithIdProvideDelegate() throws Exception { runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/delegatedPropertyWithIdProvideDelegate.kt"); @@ -13625,6 +13630,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inClass.kt"); } + @TestMetadata("inferenceFromReceiver2.kt") + public void testInferenceFromReceiver2() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inferenceFromReceiver2.kt"); + } + @TestMetadata("inlineProvideDelegate.kt") public void testInlineProvideDelegate() throws Exception { runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inlineProvideDelegate.kt"); @@ -13675,6 +13685,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/memberExtension.kt"); } + @TestMetadata("notNullAssertionInLocalDelegated.kt") + public void testNotNullAssertionInLocalDelegated() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/notNullAssertionInLocalDelegated.kt"); + } + @TestMetadata("propertyMetadata.kt") public void testPropertyMetadata() throws Exception { runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/propertyMetadata.kt"); @@ -13684,6 +13699,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes public void testProvideDelegateByExtensionFunction() throws Exception { runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/provideDelegateByExtensionFunction.kt"); } + + @TestMetadata("setValue.kt") + public void testSetValue() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/setValue.kt"); + } } } @@ -13784,6 +13804,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/delegation/hiddenSuperOverrideIn1.0.kt"); } + @TestMetadata("ifWithCallableReferenceInLazy.kt") + public void testIfWithCallableReferenceInLazy() throws Exception { + runTest("compiler/testData/codegen/box/delegation/ifWithCallableReferenceInLazy.kt"); + } + @TestMetadata("inClassDeclaration.kt") public void testInClassDeclaration() throws Exception { runTest("compiler/testData/codegen/box/delegation/inClassDeclaration.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java index 1367caf87f8..63198e9fd09 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java @@ -12490,6 +12490,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/delegatedProperty/provideDelegate"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); } + @Test + @TestMetadata("commonCaseForInference.kt") + public void testCommonCaseForInference() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/commonCaseForInference.kt"); + } + @Test @TestMetadata("delegatedPropertyWithIdProvideDelegate.kt") public void testDelegatedPropertyWithIdProvideDelegate() throws Exception { @@ -12550,6 +12556,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest { runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inClass.kt"); } + @Test + @TestMetadata("inferenceFromReceiver2.kt") + public void testInferenceFromReceiver2() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inferenceFromReceiver2.kt"); + } + @Test @TestMetadata("inlineProvideDelegate.kt") public void testInlineProvideDelegate() throws Exception { @@ -12604,6 +12616,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest { runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/memberExtension.kt"); } + @Test + @TestMetadata("notNullAssertionInLocalDelegated.kt") + public void testNotNullAssertionInLocalDelegated() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/notNullAssertionInLocalDelegated.kt"); + } + @Test @TestMetadata("propertyMetadata.kt") public void testPropertyMetadata() throws Exception { @@ -12615,6 +12633,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest { public void testProvideDelegateByExtensionFunction() throws Exception { runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/provideDelegateByExtensionFunction.kt"); } + + @Test + @TestMetadata("setValue.kt") + public void testSetValue() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/setValue.kt"); + } } } @@ -12663,6 +12687,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest { runTest("compiler/testData/codegen/box/delegation/hiddenSuperOverrideIn1.0.kt"); } + @Test + @TestMetadata("ifWithCallableReferenceInLazy.kt") + public void testIfWithCallableReferenceInLazy() throws Exception { + runTest("compiler/testData/codegen/box/delegation/ifWithCallableReferenceInLazy.kt"); + } + @Test @TestMetadata("inDataClass.kt") public void testInDataClass() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java index 423c0afaeaa..91ea39f3fc2 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java @@ -12490,6 +12490,12 @@ public class FirJsES6CodegenBoxTestGenerated extends AbstractFirJsES6CodegenBoxT KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/delegatedProperty/provideDelegate"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); } + @Test + @TestMetadata("commonCaseForInference.kt") + public void testCommonCaseForInference() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/commonCaseForInference.kt"); + } + @Test @TestMetadata("delegatedPropertyWithIdProvideDelegate.kt") public void testDelegatedPropertyWithIdProvideDelegate() throws Exception { @@ -12550,6 +12556,12 @@ public class FirJsES6CodegenBoxTestGenerated extends AbstractFirJsES6CodegenBoxT runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inClass.kt"); } + @Test + @TestMetadata("inferenceFromReceiver2.kt") + public void testInferenceFromReceiver2() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inferenceFromReceiver2.kt"); + } + @Test @TestMetadata("inlineProvideDelegate.kt") public void testInlineProvideDelegate() throws Exception { @@ -12604,6 +12616,12 @@ public class FirJsES6CodegenBoxTestGenerated extends AbstractFirJsES6CodegenBoxT runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/memberExtension.kt"); } + @Test + @TestMetadata("notNullAssertionInLocalDelegated.kt") + public void testNotNullAssertionInLocalDelegated() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/notNullAssertionInLocalDelegated.kt"); + } + @Test @TestMetadata("propertyMetadata.kt") public void testPropertyMetadata() throws Exception { @@ -12615,6 +12633,12 @@ public class FirJsES6CodegenBoxTestGenerated extends AbstractFirJsES6CodegenBoxT public void testProvideDelegateByExtensionFunction() throws Exception { runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/provideDelegateByExtensionFunction.kt"); } + + @Test + @TestMetadata("setValue.kt") + public void testSetValue() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/setValue.kt"); + } } } @@ -12663,6 +12687,12 @@ public class FirJsES6CodegenBoxTestGenerated extends AbstractFirJsES6CodegenBoxT runTest("compiler/testData/codegen/box/delegation/hiddenSuperOverrideIn1.0.kt"); } + @Test + @TestMetadata("ifWithCallableReferenceInLazy.kt") + public void testIfWithCallableReferenceInLazy() throws Exception { + runTest("compiler/testData/codegen/box/delegation/ifWithCallableReferenceInLazy.kt"); + } + @Test @TestMetadata("inDataClass.kt") public void testInDataClass() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java index c3c9c737868..82c4d6f1204 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java @@ -12490,6 +12490,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/delegatedProperty/provideDelegate"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); } + @Test + @TestMetadata("commonCaseForInference.kt") + public void testCommonCaseForInference() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/commonCaseForInference.kt"); + } + @Test @TestMetadata("delegatedPropertyWithIdProvideDelegate.kt") public void testDelegatedPropertyWithIdProvideDelegate() throws Exception { @@ -12550,6 +12556,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inClass.kt"); } + @Test + @TestMetadata("inferenceFromReceiver2.kt") + public void testInferenceFromReceiver2() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inferenceFromReceiver2.kt"); + } + @Test @TestMetadata("inlineProvideDelegate.kt") public void testInlineProvideDelegate() throws Exception { @@ -12604,6 +12616,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/memberExtension.kt"); } + @Test + @TestMetadata("notNullAssertionInLocalDelegated.kt") + public void testNotNullAssertionInLocalDelegated() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/notNullAssertionInLocalDelegated.kt"); + } + @Test @TestMetadata("propertyMetadata.kt") public void testPropertyMetadata() throws Exception { @@ -12615,6 +12633,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { public void testProvideDelegateByExtensionFunction() throws Exception { runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/provideDelegateByExtensionFunction.kt"); } + + @Test + @TestMetadata("setValue.kt") + public void testSetValue() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/setValue.kt"); + } } } @@ -12663,6 +12687,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/delegation/hiddenSuperOverrideIn1.0.kt"); } + @Test + @TestMetadata("ifWithCallableReferenceInLazy.kt") + public void testIfWithCallableReferenceInLazy() throws Exception { + runTest("compiler/testData/codegen/box/delegation/ifWithCallableReferenceInLazy.kt"); + } + @Test @TestMetadata("inDataClass.kt") public void testInDataClass() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java index 78e0958f7a5..2f2b25a0039 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java @@ -12490,6 +12490,12 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/delegatedProperty/provideDelegate"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); } + @Test + @TestMetadata("commonCaseForInference.kt") + public void testCommonCaseForInference() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/commonCaseForInference.kt"); + } + @Test @TestMetadata("delegatedPropertyWithIdProvideDelegate.kt") public void testDelegatedPropertyWithIdProvideDelegate() throws Exception { @@ -12550,6 +12556,12 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inClass.kt"); } + @Test + @TestMetadata("inferenceFromReceiver2.kt") + public void testInferenceFromReceiver2() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inferenceFromReceiver2.kt"); + } + @Test @TestMetadata("inlineProvideDelegate.kt") public void testInlineProvideDelegate() throws Exception { @@ -12604,6 +12616,12 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/memberExtension.kt"); } + @Test + @TestMetadata("notNullAssertionInLocalDelegated.kt") + public void testNotNullAssertionInLocalDelegated() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/notNullAssertionInLocalDelegated.kt"); + } + @Test @TestMetadata("propertyMetadata.kt") public void testPropertyMetadata() throws Exception { @@ -12615,6 +12633,12 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes public void testProvideDelegateByExtensionFunction() throws Exception { runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/provideDelegateByExtensionFunction.kt"); } + + @Test + @TestMetadata("setValue.kt") + public void testSetValue() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/setValue.kt"); + } } } @@ -12663,6 +12687,12 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes runTest("compiler/testData/codegen/box/delegation/hiddenSuperOverrideIn1.0.kt"); } + @Test + @TestMetadata("ifWithCallableReferenceInLazy.kt") + public void testIfWithCallableReferenceInLazy() throws Exception { + runTest("compiler/testData/codegen/box/delegation/ifWithCallableReferenceInLazy.kt"); + } + @Test @TestMetadata("inDataClass.kt") public void testInDataClass() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestGenerated.java index 9aab5de3e2c..87dc59c27f1 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestGenerated.java @@ -13542,6 +13542,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/delegatedProperty/provideDelegate"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); } + @Test + @TestMetadata("commonCaseForInference.kt") + public void testCommonCaseForInference() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/commonCaseForInference.kt"); + } + @Test @TestMetadata("delegatedPropertyWithIdProvideDelegate.kt") public void testDelegatedPropertyWithIdProvideDelegate() throws Exception { @@ -13602,6 +13608,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inClass.kt"); } + @Test + @TestMetadata("inferenceFromReceiver2.kt") + public void testInferenceFromReceiver2() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inferenceFromReceiver2.kt"); + } + @Test @TestMetadata("inlineProvideDelegate.kt") public void testInlineProvideDelegate() throws Exception { @@ -13656,6 +13668,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/memberExtension.kt"); } + @Test + @TestMetadata("notNullAssertionInLocalDelegated.kt") + public void testNotNullAssertionInLocalDelegated() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/notNullAssertionInLocalDelegated.kt"); + } + @Test @TestMetadata("propertyMetadata.kt") public void testPropertyMetadata() throws Exception { @@ -13667,6 +13685,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe public void testProvideDelegateByExtensionFunction() throws Exception { runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/provideDelegateByExtensionFunction.kt"); } + + @Test + @TestMetadata("setValue.kt") + public void testSetValue() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/setValue.kt"); + } } } @@ -13718,6 +13742,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe runTest("compiler/testData/codegen/box/delegation/hiddenSuperOverrideIn1.0.kt"); } + @Test + @TestMetadata("ifWithCallableReferenceInLazy.kt") + public void testIfWithCallableReferenceInLazy() throws Exception { + runTest("compiler/testData/codegen/box/delegation/ifWithCallableReferenceInLazy.kt"); + } + @Test @TestMetadata("inDataClass.kt") public void testInDataClass() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestNoPLGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestNoPLGenerated.java index b335c76769a..2999f0c0fc5 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestNoPLGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestNoPLGenerated.java @@ -13854,6 +13854,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/delegatedProperty/provideDelegate"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); } + @Test + @TestMetadata("commonCaseForInference.kt") + public void testCommonCaseForInference() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/commonCaseForInference.kt"); + } + @Test @TestMetadata("delegatedPropertyWithIdProvideDelegate.kt") public void testDelegatedPropertyWithIdProvideDelegate() throws Exception { @@ -13914,6 +13920,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inClass.kt"); } + @Test + @TestMetadata("inferenceFromReceiver2.kt") + public void testInferenceFromReceiver2() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inferenceFromReceiver2.kt"); + } + @Test @TestMetadata("inlineProvideDelegate.kt") public void testInlineProvideDelegate() throws Exception { @@ -13968,6 +13980,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/memberExtension.kt"); } + @Test + @TestMetadata("notNullAssertionInLocalDelegated.kt") + public void testNotNullAssertionInLocalDelegated() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/notNullAssertionInLocalDelegated.kt"); + } + @Test @TestMetadata("propertyMetadata.kt") public void testPropertyMetadata() throws Exception { @@ -13979,6 +13997,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB public void testProvideDelegateByExtensionFunction() throws Exception { runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/provideDelegateByExtensionFunction.kt"); } + + @Test + @TestMetadata("setValue.kt") + public void testSetValue() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/setValue.kt"); + } } } @@ -14032,6 +14056,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB runTest("compiler/testData/codegen/box/delegation/hiddenSuperOverrideIn1.0.kt"); } + @Test + @TestMetadata("ifWithCallableReferenceInLazy.kt") + public void testIfWithCallableReferenceInLazy() throws Exception { + runTest("compiler/testData/codegen/box/delegation/ifWithCallableReferenceInLazy.kt"); + } + @Test @TestMetadata("inDataClass.kt") public void testInDataClass() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestGenerated.java index 5a2cc9f5874..e64b4890903 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestGenerated.java @@ -13230,6 +13230,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/delegatedProperty/provideDelegate"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); } + @Test + @TestMetadata("commonCaseForInference.kt") + public void testCommonCaseForInference() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/commonCaseForInference.kt"); + } + @Test @TestMetadata("delegatedPropertyWithIdProvideDelegate.kt") public void testDelegatedPropertyWithIdProvideDelegate() throws Exception { @@ -13290,6 +13296,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inClass.kt"); } + @Test + @TestMetadata("inferenceFromReceiver2.kt") + public void testInferenceFromReceiver2() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inferenceFromReceiver2.kt"); + } + @Test @TestMetadata("inlineProvideDelegate.kt") public void testInlineProvideDelegate() throws Exception { @@ -13344,6 +13356,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/memberExtension.kt"); } + @Test + @TestMetadata("notNullAssertionInLocalDelegated.kt") + public void testNotNullAssertionInLocalDelegated() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/notNullAssertionInLocalDelegated.kt"); + } + @Test @TestMetadata("propertyMetadata.kt") public void testPropertyMetadata() throws Exception { @@ -13355,6 +13373,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest public void testProvideDelegateByExtensionFunction() throws Exception { runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/provideDelegateByExtensionFunction.kt"); } + + @Test + @TestMetadata("setValue.kt") + public void testSetValue() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/setValue.kt"); + } } } @@ -13404,6 +13428,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest runTest("compiler/testData/codegen/box/delegation/hiddenSuperOverrideIn1.0.kt"); } + @Test + @TestMetadata("ifWithCallableReferenceInLazy.kt") + public void testIfWithCallableReferenceInLazy() throws Exception { + runTest("compiler/testData/codegen/box/delegation/ifWithCallableReferenceInLazy.kt"); + } + @Test @TestMetadata("inDataClass.kt") public void testInDataClass() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestNoPLGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestNoPLGenerated.java index ba9875ea721..b3f47dd7df9 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestNoPLGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestNoPLGenerated.java @@ -13543,6 +13543,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/delegatedProperty/provideDelegate"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); } + @Test + @TestMetadata("commonCaseForInference.kt") + public void testCommonCaseForInference() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/commonCaseForInference.kt"); + } + @Test @TestMetadata("delegatedPropertyWithIdProvideDelegate.kt") public void testDelegatedPropertyWithIdProvideDelegate() throws Exception { @@ -13603,6 +13609,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inClass.kt"); } + @Test + @TestMetadata("inferenceFromReceiver2.kt") + public void testInferenceFromReceiver2() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inferenceFromReceiver2.kt"); + } + @Test @TestMetadata("inlineProvideDelegate.kt") public void testInlineProvideDelegate() throws Exception { @@ -13657,6 +13669,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/memberExtension.kt"); } + @Test + @TestMetadata("notNullAssertionInLocalDelegated.kt") + public void testNotNullAssertionInLocalDelegated() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/notNullAssertionInLocalDelegated.kt"); + } + @Test @TestMetadata("propertyMetadata.kt") public void testPropertyMetadata() throws Exception { @@ -13668,6 +13686,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT public void testProvideDelegateByExtensionFunction() throws Exception { runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/provideDelegateByExtensionFunction.kt"); } + + @Test + @TestMetadata("setValue.kt") + public void testSetValue() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/setValue.kt"); + } } } @@ -13719,6 +13743,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT runTest("compiler/testData/codegen/box/delegation/hiddenSuperOverrideIn1.0.kt"); } + @Test + @TestMetadata("ifWithCallableReferenceInLazy.kt") + public void testIfWithCallableReferenceInLazy() throws Exception { + runTest("compiler/testData/codegen/box/delegation/ifWithCallableReferenceInLazy.kt"); + } + @Test @TestMetadata("inDataClass.kt") public void testInDataClass() throws Exception { diff --git a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmCodegenBoxTestGenerated.java b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmCodegenBoxTestGenerated.java index cc6320379df..fc0e41fcf65 100644 --- a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmCodegenBoxTestGenerated.java +++ b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmCodegenBoxTestGenerated.java @@ -12466,6 +12466,12 @@ public class FirWasmCodegenBoxTestGenerated extends AbstractFirWasmCodegenBoxTes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/delegatedProperty/provideDelegate"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); } + @Test + @TestMetadata("commonCaseForInference.kt") + public void testCommonCaseForInference() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/commonCaseForInference.kt"); + } + @Test @TestMetadata("delegatedPropertyWithIdProvideDelegate.kt") public void testDelegatedPropertyWithIdProvideDelegate() throws Exception { @@ -12526,6 +12532,12 @@ public class FirWasmCodegenBoxTestGenerated extends AbstractFirWasmCodegenBoxTes runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inClass.kt"); } + @Test + @TestMetadata("inferenceFromReceiver2.kt") + public void testInferenceFromReceiver2() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inferenceFromReceiver2.kt"); + } + @Test @TestMetadata("inlineProvideDelegate.kt") public void testInlineProvideDelegate() throws Exception { @@ -12580,6 +12592,12 @@ public class FirWasmCodegenBoxTestGenerated extends AbstractFirWasmCodegenBoxTes runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/memberExtension.kt"); } + @Test + @TestMetadata("notNullAssertionInLocalDelegated.kt") + public void testNotNullAssertionInLocalDelegated() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/notNullAssertionInLocalDelegated.kt"); + } + @Test @TestMetadata("propertyMetadata.kt") public void testPropertyMetadata() throws Exception { @@ -12591,6 +12609,12 @@ public class FirWasmCodegenBoxTestGenerated extends AbstractFirWasmCodegenBoxTes public void testProvideDelegateByExtensionFunction() throws Exception { runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/provideDelegateByExtensionFunction.kt"); } + + @Test + @TestMetadata("setValue.kt") + public void testSetValue() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/setValue.kt"); + } } } @@ -12639,6 +12663,12 @@ public class FirWasmCodegenBoxTestGenerated extends AbstractFirWasmCodegenBoxTes runTest("compiler/testData/codegen/box/delegation/hiddenSuperOverrideIn1.0.kt"); } + @Test + @TestMetadata("ifWithCallableReferenceInLazy.kt") + public void testIfWithCallableReferenceInLazy() throws Exception { + runTest("compiler/testData/codegen/box/delegation/ifWithCallableReferenceInLazy.kt"); + } + @Test @TestMetadata("inDataClass.kt") public void testInDataClass() throws Exception { diff --git a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxTestGenerated.java b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxTestGenerated.java index bd132baf973..2ea117d0664 100644 --- a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxTestGenerated.java +++ b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxTestGenerated.java @@ -12466,6 +12466,12 @@ public class K1WasmCodegenBoxTestGenerated extends AbstractK1WasmCodegenBoxTest KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/delegatedProperty/provideDelegate"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); } + @Test + @TestMetadata("commonCaseForInference.kt") + public void testCommonCaseForInference() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/commonCaseForInference.kt"); + } + @Test @TestMetadata("delegatedPropertyWithIdProvideDelegate.kt") public void testDelegatedPropertyWithIdProvideDelegate() throws Exception { @@ -12526,6 +12532,12 @@ public class K1WasmCodegenBoxTestGenerated extends AbstractK1WasmCodegenBoxTest runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inClass.kt"); } + @Test + @TestMetadata("inferenceFromReceiver2.kt") + public void testInferenceFromReceiver2() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inferenceFromReceiver2.kt"); + } + @Test @TestMetadata("inlineProvideDelegate.kt") public void testInlineProvideDelegate() throws Exception { @@ -12580,6 +12592,12 @@ public class K1WasmCodegenBoxTestGenerated extends AbstractK1WasmCodegenBoxTest runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/memberExtension.kt"); } + @Test + @TestMetadata("notNullAssertionInLocalDelegated.kt") + public void testNotNullAssertionInLocalDelegated() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/notNullAssertionInLocalDelegated.kt"); + } + @Test @TestMetadata("propertyMetadata.kt") public void testPropertyMetadata() throws Exception { @@ -12591,6 +12609,12 @@ public class K1WasmCodegenBoxTestGenerated extends AbstractK1WasmCodegenBoxTest public void testProvideDelegateByExtensionFunction() throws Exception { runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/provideDelegateByExtensionFunction.kt"); } + + @Test + @TestMetadata("setValue.kt") + public void testSetValue() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/provideDelegate/setValue.kt"); + } } } @@ -12639,6 +12663,12 @@ public class K1WasmCodegenBoxTestGenerated extends AbstractK1WasmCodegenBoxTest runTest("compiler/testData/codegen/box/delegation/hiddenSuperOverrideIn1.0.kt"); } + @Test + @TestMetadata("ifWithCallableReferenceInLazy.kt") + public void testIfWithCallableReferenceInLazy() throws Exception { + runTest("compiler/testData/codegen/box/delegation/ifWithCallableReferenceInLazy.kt"); + } + @Test @TestMetadata("inDataClass.kt") public void testInDataClass() throws Exception {