[KAPT4] KT-62097 Keep import statements for unresolved annotation classes
This commit is contained in:
committed by
Space Team
parent
731a1dd98d
commit
6a2cea8a8e
+22
@@ -0,0 +1,22 @@
|
||||
import com.example.Unresolved1;
|
||||
import org.example.*;
|
||||
import org.another.*;
|
||||
|
||||
/**
|
||||
* public final class C : kotlin/Any {
|
||||
*
|
||||
* // signature: <init>()V
|
||||
* public constructor()
|
||||
*
|
||||
* // module name: main
|
||||
* }
|
||||
*/
|
||||
@kotlin.Metadata()
|
||||
@Unresolved1()
|
||||
@Unresolved2()
|
||||
public final class C {
|
||||
|
||||
public C() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// CORRECT_ERROR_TYPES
|
||||
// EXPECTED_ERROR: (kotlin:10:1) cannot find symbol
|
||||
|
||||
|
||||
@file:Suppress("UNRESOLVED_REFERENCE")
|
||||
import com.example.Unresolved1
|
||||
import org.example.*
|
||||
import org.another.*
|
||||
|
||||
@Unresolved1
|
||||
@Unresolved2
|
||||
class C
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
import com.example.Unresolved1;
|
||||
import org.example.*;
|
||||
import org.another.*;
|
||||
|
||||
@Unresolved1()
|
||||
@Unresolved2()
|
||||
/**
|
||||
* public final class C : kotlin/Any {
|
||||
*
|
||||
* // signature: <init>()V
|
||||
* public constructor()
|
||||
*
|
||||
* // module name: main
|
||||
* }
|
||||
*/
|
||||
@kotlin.Metadata()
|
||||
public final class C {
|
||||
|
||||
public C() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
+6
@@ -307,6 +307,12 @@ public class ClassFileToSourceStubConverterTestGenerated extends AbstractClassFi
|
||||
runTest("plugins/kapt3/kapt3-compiler/testData/converter/importsKt22083.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("importsWithUnresolvedAnnotations.kt")
|
||||
public void testImportsWithUnresolvedAnnotations() throws Exception {
|
||||
runTest("plugins/kapt3/kapt3-compiler/testData/converter/importsWithUnresolvedAnnotations.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("incorrectDelegate.kt")
|
||||
public void testIncorrectDelegate() throws Exception {
|
||||
|
||||
+6
@@ -307,6 +307,12 @@ public class IrClassFileToSourceStubConverterTestGenerated extends AbstractIrCla
|
||||
runTest("plugins/kapt3/kapt3-compiler/testData/converter/importsKt22083.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("importsWithUnresolvedAnnotations.kt")
|
||||
public void testImportsWithUnresolvedAnnotations() throws Exception {
|
||||
runTest("plugins/kapt3/kapt3-compiler/testData/converter/importsWithUnresolvedAnnotations.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("incorrectDelegate.kt")
|
||||
public void testIncorrectDelegate() throws Exception {
|
||||
|
||||
@@ -326,6 +326,7 @@ internal class Kapt4StubGenerator {
|
||||
val rawQualifiedName = when (annotation.qualifiedName) {
|
||||
// A temporary fix for KT-60482
|
||||
"<error>" -> (annotation as? KtLightElement<*, *>)?.kotlinOrigin?.node?.let { qualifiedName(it) }
|
||||
?.also { recordUnresolvedQualifier(it) }
|
||||
else -> annotation.qualifiedName
|
||||
} ?: return null
|
||||
|
||||
|
||||
+6
@@ -307,6 +307,12 @@ public class KotlinKapt4ContextTestGenerated extends AbstractKotlinKapt4ContextT
|
||||
runTest("plugins/kapt4/../kapt3/kapt3-compiler/testData/converter/importsKt22083.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("importsWithUnresolvedAnnotations.kt")
|
||||
public void testImportsWithUnresolvedAnnotations() throws Exception {
|
||||
runTest("plugins/kapt4/../kapt3/kapt3-compiler/testData/converter/importsWithUnresolvedAnnotations.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("incorrectDelegate.kt")
|
||||
public void testIncorrectDelegate() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user