diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java index 815184bb5eb..449709ae27d 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java @@ -14424,6 +14424,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/imports/RenameOnImport.kt"); } + @Test + @TestMetadata("renamedImportInDifferentFile.kt") + public void testRenamedImportInDifferentFile() throws Exception { + runTest("compiler/testData/diagnostics/tests/imports/renamedImportInDifferentFile.kt"); + } + @Test @TestMetadata("StarImportFromObject.kt") public void testStarImportFromObject() throws Exception { diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java index be08946beaf..028c1db7732 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java @@ -14424,6 +14424,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/imports/RenameOnImport.kt"); } + @Test + @TestMetadata("renamedImportInDifferentFile.kt") + public void testRenamedImportInDifferentFile() throws Exception { + runTest("compiler/testData/diagnostics/tests/imports/renamedImportInDifferentFile.kt"); + } + @Test @TestMetadata("StarImportFromObject.kt") public void testStarImportFromObject() throws Exception { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java index ea1d6231ecc..4c9ee08fb17 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java @@ -14424,6 +14424,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/imports/RenameOnImport.kt"); } + @Test + @TestMetadata("renamedImportInDifferentFile.kt") + public void testRenamedImportInDifferentFile() throws Exception { + runTest("compiler/testData/diagnostics/tests/imports/renamedImportInDifferentFile.kt"); + } + @Test @TestMetadata("StarImportFromObject.kt") public void testStarImportFromObject() throws Exception { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java index 2d424e4c8d1..e6b725938b6 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java @@ -14430,6 +14430,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/imports/RenameOnImport.kt"); } + @Test + @TestMetadata("renamedImportInDifferentFile.kt") + public void testRenamedImportInDifferentFile() throws Exception { + runTest("compiler/testData/diagnostics/tests/imports/renamedImportInDifferentFile.kt"); + } + @Test @TestMetadata("StarImportFromObject.kt") public void testStarImportFromObject() throws Exception { diff --git a/compiler/testData/diagnostics/tests/imports/renamedImportInDifferentFile.fir.kt b/compiler/testData/diagnostics/tests/imports/renamedImportInDifferentFile.fir.kt new file mode 100644 index 00000000000..862725a662d --- /dev/null +++ b/compiler/testData/diagnostics/tests/imports/renamedImportInDifferentFile.fir.kt @@ -0,0 +1,22 @@ +// ISSUE: KT-59789 +// FILE: a/A.java +package a; +public interface A {} + +// FILE: first.kt +package b +import b.DependencyAnalyzerDependency as Dependency + +fun foo(d: Dependency) {} + +// FILE: main.kt +package b + +import a.A +interface DependencyAnalyzerDependency : A { + val parent: DependencyAnalyzerDependency? // Should be resolved +} + +fun bar(d: DependencyAnalyzerDependency) { + foo(d) +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/imports/renamedImportInDifferentFile.kt b/compiler/testData/diagnostics/tests/imports/renamedImportInDifferentFile.kt new file mode 100644 index 00000000000..75242c6bab8 --- /dev/null +++ b/compiler/testData/diagnostics/tests/imports/renamedImportInDifferentFile.kt @@ -0,0 +1,22 @@ +// ISSUE: KT-59789 +// FILE: a/A.java +package a; +public interface A {} + +// FILE: first.kt +package b +import b.DependencyAnalyzerDependency as Dependency + +fun foo(d: Dependency) {} + +// FILE: main.kt +package b + +import a.A +interface DependencyAnalyzerDependency : A { + val parent: DependencyAnalyzerDependency? // Should be resolved +} + +fun bar(d: DependencyAnalyzerDependency) { + foo(d) +} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java index 5ea162a26d0..78bcf25ee22 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java @@ -14430,6 +14430,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/imports/RenameOnImport.kt"); } + @Test + @TestMetadata("renamedImportInDifferentFile.kt") + public void testRenamedImportInDifferentFile() throws Exception { + runTest("compiler/testData/diagnostics/tests/imports/renamedImportInDifferentFile.kt"); + } + @Test @TestMetadata("StarImportFromObject.kt") public void testStarImportFromObject() throws Exception {