Add test on "inconsistent type parameter bounds"

It seems that all tests on that diagnostic were replaced in previous commits by
"repeated bound" and "no other bounds except a type parameter bound"
diagnostics
This commit is contained in:
Alexander Udalov
2015-11-30 22:54:15 +03:00
parent d3c17ec337
commit 2dce7ad1e2
3 changed files with 66 additions and 0 deletions
@@ -0,0 +1,7 @@
interface A
interface B : A
interface ListA : List<A>
interface ListB : List<B>
interface Z<<!INCONSISTENT_TYPE_PARAMETER_BOUNDS, INCONSISTENT_TYPE_PARAMETER_BOUNDS, INCONSISTENT_TYPE_PARAMETER_BOUNDS!>T<!>> where T : ListA, T : ListB
@@ -0,0 +1,53 @@
package
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
}
public interface B : 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
}
public interface ListA : kotlin.List<A> {
public abstract override /*1*/ /*fake_override*/ val size: kotlin.Int
public abstract override /*1*/ /*fake_override*/ fun contains(/*0*/ element: A): kotlin.Boolean
public abstract override /*1*/ /*fake_override*/ fun containsAll(/*0*/ elements: kotlin.Collection<A>): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract override /*1*/ /*fake_override*/ fun get(/*0*/ index: kotlin.Int): A
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public abstract override /*1*/ /*fake_override*/ fun indexOf(/*0*/ element: A): kotlin.Int
public abstract override /*1*/ /*fake_override*/ fun isEmpty(): kotlin.Boolean
public abstract override /*1*/ /*fake_override*/ fun iterator(): kotlin.Iterator<A>
public abstract override /*1*/ /*fake_override*/ fun lastIndexOf(/*0*/ element: A): kotlin.Int
public abstract override /*1*/ /*fake_override*/ fun listIterator(): kotlin.ListIterator<A>
public abstract override /*1*/ /*fake_override*/ fun listIterator(/*0*/ index: kotlin.Int): kotlin.ListIterator<A>
public abstract override /*1*/ /*fake_override*/ fun subList(/*0*/ fromIndex: kotlin.Int, /*1*/ toIndex: kotlin.Int): kotlin.List<A>
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public interface ListB : kotlin.List<B> {
public abstract override /*1*/ /*fake_override*/ val size: kotlin.Int
public abstract override /*1*/ /*fake_override*/ fun contains(/*0*/ element: B): kotlin.Boolean
public abstract override /*1*/ /*fake_override*/ fun containsAll(/*0*/ elements: kotlin.Collection<B>): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract override /*1*/ /*fake_override*/ fun get(/*0*/ index: kotlin.Int): B
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public abstract override /*1*/ /*fake_override*/ fun indexOf(/*0*/ element: B): kotlin.Int
public abstract override /*1*/ /*fake_override*/ fun isEmpty(): kotlin.Boolean
public abstract override /*1*/ /*fake_override*/ fun iterator(): kotlin.Iterator<B>
public abstract override /*1*/ /*fake_override*/ fun lastIndexOf(/*0*/ element: B): kotlin.Int
public abstract override /*1*/ /*fake_override*/ fun listIterator(): kotlin.ListIterator<B>
public abstract override /*1*/ /*fake_override*/ fun listIterator(/*0*/ index: kotlin.Int): kotlin.ListIterator<B>
public abstract override /*1*/ /*fake_override*/ fun subList(/*0*/ fromIndex: kotlin.Int, /*1*/ toIndex: kotlin.Int): kotlin.List<B>
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public interface Z</*0*/ T : ListA> where T : ListB {
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
}
@@ -6624,6 +6624,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
doTest(fileName);
}
@TestMetadata("InconsistentTypeParameterBounds.kt")
public void testInconsistentTypeParameterBounds() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/generics/InconsistentTypeParameterBounds.kt");
doTest(fileName);
}
@TestMetadata("kt1575-Class.kt")
public void testKt1575_Class() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/generics/kt1575-Class.kt");