diff --git a/plugins/fir-plugin-prototype/testData/diagnostics/checkers/importsWithGeneratedDeclarations.fir.txt b/plugins/fir-plugin-prototype/testData/diagnostics/checkers/importsWithGeneratedDeclarations.fir.txt new file mode 100644 index 00000000000..9f84702fa5c --- /dev/null +++ b/plugins/fir-plugin-prototype/testData/diagnostics/checkers/importsWithGeneratedDeclarations.fir.txt @@ -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() + } + + public final fun materialize(): R|test/MyClassWithNested| + + public final class Nested : R|kotlin/Any| { + public constructor(): R|test/MyClassWithNested.Nested| { + super() + } + + } + + } +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() + } + + public final companion object Companion : R|kotlin/Any| { + public final fun foo(): R|kotlin/Int| + + private constructor(): R|test/MyClassWithCompanion.Companion| { + super() + } + + } + + } diff --git a/plugins/fir-plugin-prototype/testData/diagnostics/checkers/importsWithGeneratedDeclarations.kt b/plugins/fir-plugin-prototype/testData/diagnostics/checkers/importsWithGeneratedDeclarations.kt new file mode 100644 index 00000000000..f8cc3fb558c --- /dev/null +++ b/plugins/fir-plugin-prototype/testData/diagnostics/checkers/importsWithGeneratedDeclarations.kt @@ -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.FakeNested +import test.MyClassWithNested.FakeNested.* + +// cannot import member +import test.MyClassWithNested.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.Companion.* + +@CompanionWithFoo +class MyClassWithCompanion + + + diff --git a/plugins/fir-plugin-prototype/tests-gen/org/jetbrains/kotlin/fir/plugin/runners/FirPsiPluginDiagnosticTestGenerated.java b/plugins/fir-plugin-prototype/tests-gen/org/jetbrains/kotlin/fir/plugin/runners/FirPsiPluginDiagnosticTestGenerated.java index 5f2189c43bd..9c3ca3c2512 100644 --- a/plugins/fir-plugin-prototype/tests-gen/org/jetbrains/kotlin/fir/plugin/runners/FirPsiPluginDiagnosticTestGenerated.java +++ b/plugins/fir-plugin-prototype/tests-gen/org/jetbrains/kotlin/fir/plugin/runners/FirPsiPluginDiagnosticTestGenerated.java @@ -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 {