KT-4960 Redeclaration is not reported for type parameters of interfaces

When resolving a class body for a class without a primary constructor
(e.g., an interface), no checks were performed for redeclarations
in the corresponding class header.
Creating & initializing a lexical scope of an appropriate kind will do it.
Note that since class has no primary constructor, only type parameters
could be redeclared (and that's KT-4960).
This commit is contained in:
Dmitry Petrov
2017-03-28 15:59:33 +03:00
parent eb0c0a8869
commit 5ccfbcbe22
6 changed files with 62 additions and 2 deletions
@@ -15949,6 +15949,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
doTest(fileName);
}
@TestMetadata("interfaceTypeParameters.kt")
public void testInterfaceTypeParameters() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/redeclarations/interfaceTypeParameters.kt");
doTest(fileName);
}
@TestMetadata("kt2418.kt")
public void testKt2418() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/redeclarations/kt2418.kt");