Check of type parameter bounds consistency #KT-9438 Fixed

This commit is contained in:
Mikhail Glukhikh
2015-10-19 12:13:35 +03:00
parent 73176fae17
commit 3151d4ca9d
9 changed files with 166 additions and 14 deletions
+11
View File
@@ -0,0 +1,11 @@
// See KT-9438: Enforce the Single Instantiation Inheritance Rule for type parameters
interface A
interface B
interface D<T>
interface CorrectF<<error descr="[INCONSISTENT_TYPE_PARAMETER_BOUNDS] Type parameter T of 'D' has inconsistent bounds: A, B">T</error>> where T : D<A>, T : D<B>
fun <<error descr="[INCONSISTENT_TYPE_PARAMETER_BOUNDS] Type parameter T of 'D' has inconsistent bounds: A, B">T</error>> bar() where T : D<A>, T : D<B> {}
@@ -325,6 +325,12 @@ public class JetPsiCheckerTestGenerated extends AbstractJetPsiCheckerTest {
doTest(fileName);
}
@TestMetadata("TypeParameterBounds.kt")
public void testTypeParameterBounds() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/checker/TypeParameterBounds.kt");
doTest(fileName);
}
@TestMetadata("UnreachableCode.kt")
public void testUnreachableCode() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/checker/UnreachableCode.kt");