KT-59732 [FIR] Add testdata to check incorrect imports with test compiler plugins
This commit is contained in:
committed by
Space Team
parent
99c7fab401
commit
776926518d
Vendored
+36
@@ -0,0 +1,36 @@
|
||||
FILE: test_NestedClassAndMaterializeMember.kt
|
||||
package test
|
||||
|
||||
@R|org/jetbrains/kotlin/fir/plugin/NestedClassAndMaterializeMember|() public final class MyClassWithNested : R|kotlin/Any| {
|
||||
public constructor(): R|test/MyClassWithNested| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final fun materialize(): R|test/MyClassWithNested|
|
||||
|
||||
public final class Nested : R|kotlin/Any| {
|
||||
public constructor(): R|test/MyClassWithNested.Nested| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
FILE: test_CompanionWithFoo.kt
|
||||
package test
|
||||
|
||||
@R|org/jetbrains/kotlin/fir/plugin/CompanionWithFoo|() public final class MyClassWithCompanion : R|kotlin/Any| {
|
||||
public constructor(): R|test/MyClassWithCompanion| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final companion object Companion : R|kotlin/Any| {
|
||||
public final fun foo(): R|kotlin/Int|
|
||||
|
||||
private constructor(): R|test/MyClassWithCompanion.Companion| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Vendored
+37
@@ -0,0 +1,37 @@
|
||||
// FILE: test_NestedClassAndMaterializeMember.kt
|
||||
package test
|
||||
|
||||
import org.jetbrains.kotlin.fir.plugin.NestedClassAndMaterializeMember
|
||||
|
||||
import test.MyClassWithNested.*
|
||||
|
||||
import test.MyClassWithNested.Nested
|
||||
import test.MyClassWithNested.Nested.*
|
||||
|
||||
// does not exist
|
||||
import test.MyClassWithNested.<!UNRESOLVED_IMPORT!>FakeNested<!>
|
||||
import test.MyClassWithNested.<!UNRESOLVED_IMPORT!>FakeNested<!>.*
|
||||
|
||||
// cannot import member
|
||||
import test.MyClassWithNested.<!CANNOT_BE_IMPORTED!>materialize<!>
|
||||
|
||||
@NestedClassAndMaterializeMember
|
||||
class MyClassWithNested
|
||||
|
||||
// FILE: test_CompanionWithFoo.kt
|
||||
package test
|
||||
|
||||
import org.jetbrains.kotlin.fir.plugin.CompanionWithFoo
|
||||
|
||||
import test.MyClassWithCompanion.*
|
||||
import test.MyClassWithCompanion.Companion
|
||||
import test.MyClassWithCompanion.Companion.foo
|
||||
|
||||
// cannot star import from companion
|
||||
import test.MyClassWithCompanion.<!CANNOT_ALL_UNDER_IMPORT_FROM_SINGLETON!>Companion<!>.*
|
||||
|
||||
@CompanionWithFoo
|
||||
class MyClassWithCompanion
|
||||
|
||||
|
||||
|
||||
+6
@@ -39,6 +39,12 @@ public class FirPsiPluginDiagnosticTestGenerated extends AbstractFirPsiPluginDia
|
||||
runTest("plugins/fir-plugin-prototype/testData/diagnostics/checkers/dependencyWithoutAttributePlugin.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("importsWithGeneratedDeclarations.kt")
|
||||
public void testImportsWithGeneratedDeclarations() throws Exception {
|
||||
runTest("plugins/fir-plugin-prototype/testData/diagnostics/checkers/importsWithGeneratedDeclarations.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mixingComposableAndNormalFunctions.kt")
|
||||
public void testMixingComposableAndNormalFunctions() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user