Run classifier usage checkers after all imports are resolved

Otherwise the diagnostic was not reported on an unused import of a deprecated
class in diagnostic tests, see the test case
This commit is contained in:
Alexander Udalov
2016-09-26 15:01:12 +03:00
parent f7b4d7d35b
commit ec53efd869
4 changed files with 28 additions and 2 deletions
@@ -209,10 +209,10 @@ class LazyTopDownAnalyzer(
bodyResolver.resolveBodies(c)
ClassifierUsageChecker.check(declarations, trace, classifierUsageCheckers)
resolveImportsInAllFiles(c)
ClassifierUsageChecker.check(declarations, trace, classifierUsageCheckers)
return c
}
@@ -0,0 +1,10 @@
// FILE: A.kt
package test
@Deprecated("A")
interface A
// FILE: B.kt
import test.<!DEPRECATION!>A<!>
@@ -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
}
}
@@ -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")