From 17e4ed8ffc7f5d25418df074bfe0069b4fd4a788 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Tue, 21 Mar 2023 22:12:58 +0100 Subject: [PATCH] Kapt+JVM_IR: add stub converter test for KT-57388 --- .../unresolvedDelegateExpression.ir.txt | 44 +++++++++++++++++++ .../converter/unresolvedDelegateExpression.kt | 12 +++++ .../unresolvedDelegateExpression.txt | 44 +++++++++++++++++++ ...ileToSourceStubConverterTestGenerated.java | 6 +++ ...ileToSourceStubConverterTestGenerated.java | 6 +++ 5 files changed, 112 insertions(+) create mode 100644 plugins/kapt3/kapt3-compiler/testData/converter/unresolvedDelegateExpression.ir.txt create mode 100644 plugins/kapt3/kapt3-compiler/testData/converter/unresolvedDelegateExpression.kt create mode 100644 plugins/kapt3/kapt3-compiler/testData/converter/unresolvedDelegateExpression.txt diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/unresolvedDelegateExpression.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/unresolvedDelegateExpression.ir.txt new file mode 100644 index 0000000000000..c989bd4b86f4a --- /dev/null +++ b/plugins/kapt3/kapt3-compiler/testData/converter/unresolvedDelegateExpression.ir.txt @@ -0,0 +1,44 @@ +@kotlin.Metadata() +@kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"}) +public final class B implements NonExisting { + @org.jetbrains.annotations.NotNull() + private final java.lang.String a$delegate = null; + + public B() { + super(); + } + + @org.jetbrains.annotations.NotNull() + public final java.lang.String getA() { + return null; + } + + @kotlin.Suppress(names = {"UNRESOLVED_REFERENCE_WRONG_RECEIVER"}) + @java.lang.Deprecated() + public static void getA$annotations() { + } +} + +//////////////////// + + +@kotlin.Metadata() +public class C { + + public C() { + super(); + } +} + +//////////////////// + + +@kotlin.Metadata() +public final class UnresolvedDelegateExpressionKt { + + @org.jetbrains.annotations.NotNull() + public static final java.lang.String flaf(@org.jetbrains.annotations.NotNull() + C $this$flaf) { + return null; + } +} diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/unresolvedDelegateExpression.kt b/plugins/kapt3/kapt3-compiler/testData/converter/unresolvedDelegateExpression.kt new file mode 100644 index 0000000000000..7c5c71bc82258 --- /dev/null +++ b/plugins/kapt3/kapt3-compiler/testData/converter/unresolvedDelegateExpression.kt @@ -0,0 +1,12 @@ +// CORRECT_ERROR_TYPES +// NO_VALIDATION + +open class C + +@Suppress("UNRESOLVED_REFERENCE") +class B : NonExisting { + @Suppress("UNRESOLVED_REFERENCE_WRONG_RECEIVER") + val a: String by flaf() +} + +fun C.flaf() = "OK" diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/unresolvedDelegateExpression.txt b/plugins/kapt3/kapt3-compiler/testData/converter/unresolvedDelegateExpression.txt new file mode 100644 index 0000000000000..8c92724f941f0 --- /dev/null +++ b/plugins/kapt3/kapt3-compiler/testData/converter/unresolvedDelegateExpression.txt @@ -0,0 +1,44 @@ +@kotlin.Metadata() +@kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"}) +public final class B implements NonExisting { + @org.jetbrains.annotations.NotNull() + private final java.lang.Object a$delegate = null; + + public B() { + super(); + } + + @org.jetbrains.annotations.NotNull() + public final java.lang.String getA() { + return null; + } + + @kotlin.Suppress(names = {"UNRESOLVED_REFERENCE_WRONG_RECEIVER"}) + @java.lang.Deprecated() + public static void getA$annotations() { + } +} + +//////////////////// + + +@kotlin.Metadata() +public class C { + + public C() { + super(); + } +} + +//////////////////// + + +@kotlin.Metadata() +public final class UnresolvedDelegateExpressionKt { + + @org.jetbrains.annotations.NotNull() + public static final java.lang.String flaf(@org.jetbrains.annotations.NotNull() + C $this$flaf) { + return null; + } +} diff --git a/plugins/kapt3/kapt3-compiler/tests-gen/org/jetbrains/kotlin/kapt3/test/runners/ClassFileToSourceStubConverterTestGenerated.java b/plugins/kapt3/kapt3-compiler/tests-gen/org/jetbrains/kotlin/kapt3/test/runners/ClassFileToSourceStubConverterTestGenerated.java index 79e809263742a..7779172f45639 100644 --- a/plugins/kapt3/kapt3-compiler/tests-gen/org/jetbrains/kotlin/kapt3/test/runners/ClassFileToSourceStubConverterTestGenerated.java +++ b/plugins/kapt3/kapt3-compiler/tests-gen/org/jetbrains/kotlin/kapt3/test/runners/ClassFileToSourceStubConverterTestGenerated.java @@ -631,6 +631,12 @@ public void testTopLevel() throws Exception { runTest("plugins/kapt3/kapt3-compiler/testData/converter/topLevel.kt"); } + @Test + @TestMetadata("unresolvedDelegateExpression.kt") + public void testUnresolvedDelegateExpression() throws Exception { + runTest("plugins/kapt3/kapt3-compiler/testData/converter/unresolvedDelegateExpression.kt"); + } + @Test @TestMetadata("unsafePropertyInitializers.kt") public void testUnsafePropertyInitializers() throws Exception { diff --git a/plugins/kapt3/kapt3-compiler/tests-gen/org/jetbrains/kotlin/kapt3/test/runners/IrClassFileToSourceStubConverterTestGenerated.java b/plugins/kapt3/kapt3-compiler/tests-gen/org/jetbrains/kotlin/kapt3/test/runners/IrClassFileToSourceStubConverterTestGenerated.java index 7d696c84a6002..66aac5f1634f3 100644 --- a/plugins/kapt3/kapt3-compiler/tests-gen/org/jetbrains/kotlin/kapt3/test/runners/IrClassFileToSourceStubConverterTestGenerated.java +++ b/plugins/kapt3/kapt3-compiler/tests-gen/org/jetbrains/kotlin/kapt3/test/runners/IrClassFileToSourceStubConverterTestGenerated.java @@ -631,6 +631,12 @@ public void testTopLevel() throws Exception { runTest("plugins/kapt3/kapt3-compiler/testData/converter/topLevel.kt"); } + @Test + @TestMetadata("unresolvedDelegateExpression.kt") + public void testUnresolvedDelegateExpression() throws Exception { + runTest("plugins/kapt3/kapt3-compiler/testData/converter/unresolvedDelegateExpression.kt"); + } + @Test @TestMetadata("unsafePropertyInitializers.kt") public void testUnsafePropertyInitializers() throws Exception {