diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/LazyTopDownAnalyzer.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/LazyTopDownAnalyzer.kt index 907c07813e6..025402e5a31 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/LazyTopDownAnalyzer.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/LazyTopDownAnalyzer.kt @@ -209,10 +209,10 @@ class LazyTopDownAnalyzer( bodyResolver.resolveBodies(c) - ClassifierUsageChecker.check(declarations, trace, classifierUsageCheckers) - resolveImportsInAllFiles(c) + ClassifierUsageChecker.check(declarations, trace, classifierUsageCheckers) + return c } diff --git a/compiler/testData/diagnostics/tests/deprecated/unusedImport.kt b/compiler/testData/diagnostics/tests/deprecated/unusedImport.kt new file mode 100644 index 00000000000..0263fbf30e1 --- /dev/null +++ b/compiler/testData/diagnostics/tests/deprecated/unusedImport.kt @@ -0,0 +1,10 @@ +// FILE: A.kt + +package test + +@Deprecated("A") +interface A + +// FILE: B.kt + +import test.A diff --git a/compiler/testData/diagnostics/tests/deprecated/unusedImport.txt b/compiler/testData/diagnostics/tests/deprecated/unusedImport.txt new file mode 100644 index 00000000000..a4446578fa8 --- /dev/null +++ b/compiler/testData/diagnostics/tests/deprecated/unusedImport.txt @@ -0,0 +1,10 @@ +package + +package test { + + @kotlin.Deprecated(message = "A") public interface A { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } +} diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java index 5d4d64d23ce..581f5adc164 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java @@ -6005,6 +6005,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/deprecated/typeUsage.kt"); doTest(fileName); } + + @TestMetadata("unusedImport.kt") + public void testUnusedImport() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/deprecated/unusedImport.kt"); + doTest(fileName); + } } @TestMetadata("compiler/testData/diagnostics/tests/duplicateJvmSignature")