From aa97bb8cfc5613dbc718394cca942e73cbbd80e5 Mon Sep 17 00:00:00 2001 From: Stanislav Erokhin Date: Tue, 9 Sep 2014 19:27:12 +0400 Subject: [PATCH] Added Variance tests --- .../diagnostics/tests/variance/Class.kt | 23 ++++ .../diagnostics/tests/variance/Class.txt | 128 ++++++++++++++++++ .../diagnostics/tests/variance/Function.kt | 34 +++++ .../diagnostics/tests/variance/Function.txt | 50 +++++++ .../diagnostics/tests/variance/InPosition.kt | 48 +++++++ .../diagnostics/tests/variance/InPosition.txt | 68 ++++++++++ .../tests/variance/InvariantPosition.kt | 45 ++++++ .../tests/variance/InvariantPosition.txt | 65 +++++++++ .../diagnostics/tests/variance/OutPosition.kt | 40 ++++++ .../tests/variance/OutPosition.txt | 60 ++++++++ .../tests/variance/PrimaryConstructor.kt | 25 ++++ .../tests/variance/PrimaryConstructor.txt | 38 ++++++ .../diagnostics/tests/variance/ValProperty.kt | 48 +++++++ .../tests/variance/ValProperty.txt | 67 +++++++++ .../diagnostics/tests/variance/VarProperty.kt | 48 +++++++ .../tests/variance/VarProperty.txt | 67 +++++++++ .../diagnostics/tests/variance/Visibility.kt | 20 +++ .../diagnostics/tests/variance/Visibility.txt | 19 +++ .../checkers/JetDiagnosticsTestGenerated.java | 65 ++++++++- 19 files changed, 957 insertions(+), 1 deletion(-) create mode 100644 compiler/testData/diagnostics/tests/variance/Class.kt create mode 100644 compiler/testData/diagnostics/tests/variance/Class.txt create mode 100644 compiler/testData/diagnostics/tests/variance/Function.kt create mode 100644 compiler/testData/diagnostics/tests/variance/Function.txt create mode 100644 compiler/testData/diagnostics/tests/variance/InPosition.kt create mode 100644 compiler/testData/diagnostics/tests/variance/InPosition.txt create mode 100644 compiler/testData/diagnostics/tests/variance/InvariantPosition.kt create mode 100644 compiler/testData/diagnostics/tests/variance/InvariantPosition.txt create mode 100644 compiler/testData/diagnostics/tests/variance/OutPosition.kt create mode 100644 compiler/testData/diagnostics/tests/variance/OutPosition.txt create mode 100644 compiler/testData/diagnostics/tests/variance/PrimaryConstructor.kt create mode 100644 compiler/testData/diagnostics/tests/variance/PrimaryConstructor.txt create mode 100644 compiler/testData/diagnostics/tests/variance/ValProperty.kt create mode 100644 compiler/testData/diagnostics/tests/variance/ValProperty.txt create mode 100644 compiler/testData/diagnostics/tests/variance/VarProperty.kt create mode 100644 compiler/testData/diagnostics/tests/variance/VarProperty.txt create mode 100644 compiler/testData/diagnostics/tests/variance/Visibility.kt create mode 100644 compiler/testData/diagnostics/tests/variance/Visibility.txt diff --git a/compiler/testData/diagnostics/tests/variance/Class.kt b/compiler/testData/diagnostics/tests/variance/Class.kt new file mode 100644 index 00000000000..0f1ed851ea8 --- /dev/null +++ b/compiler/testData/diagnostics/tests/variance/Class.kt @@ -0,0 +1,23 @@ +trait In +trait Out +trait Inv + +trait TypeBounds1I> +trait TypeBounds2 +trait TypeBounds3 +trait TypeBounds4> +trait TypeBounds5)!>O>> + +trait WhereTypeBounds1 where X : I +trait WhereTypeBounds2 where X : O +trait WhereTypeBounds3 where X : P +trait WhereTypeBounds4 where X : In +trait WhereTypeBounds5 where X : In<)!>O> + +class SubClass1 : Out<)!>I> +class SubClass2 : Out +class SubClass3 : Out

+class SubClass4 : In +class SubClass5 : In<)!>O> +class SubClass6 : Inv<)!>O> +class SubClass7 : Inv<)!>I> \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/variance/Class.txt b/compiler/testData/diagnostics/tests/variance/Class.txt new file mode 100644 index 00000000000..a0c42d657fe --- /dev/null +++ b/compiler/testData/diagnostics/tests/variance/Class.txt @@ -0,0 +1,128 @@ +package + +internal trait In { + 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 +} + +internal trait Inv { + 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 +} + +internal trait Out { + 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 +} + +internal final class SubClass1 : Out { + public constructor SubClass1() + 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 +} + +internal final class SubClass2 : Out { + public constructor SubClass2() + 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 +} + +internal final class SubClass3 : Out

{ + public constructor SubClass3() + 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 +} + +internal final class SubClass4 : In { + public constructor SubClass4() + 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 +} + +internal final class SubClass5 : In { + public constructor SubClass5() + 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 +} + +internal final class SubClass6 : Inv { + public constructor SubClass6() + 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 +} + +internal final class SubClass7 : Inv { + public constructor SubClass7() + 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 +} + +internal trait TypeBounds1 { + 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 +} + +internal trait TypeBounds2 { + 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 +} + +internal trait TypeBounds3 { + 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 +} + +internal trait TypeBounds4> { + 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 +} + +internal trait TypeBounds5> { + 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 +} + +internal trait WhereTypeBounds1 { + 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 +} + +internal trait WhereTypeBounds2 { + 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 +} + +internal trait WhereTypeBounds3 { + 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 +} + +internal trait WhereTypeBounds4> { + 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 +} + +internal trait WhereTypeBounds5> { + 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/testData/diagnostics/tests/variance/Function.kt b/compiler/testData/diagnostics/tests/variance/Function.kt new file mode 100644 index 00000000000..6759027da40 --- /dev/null +++ b/compiler/testData/diagnostics/tests/variance/Function.kt @@ -0,0 +1,34 @@ +trait In +trait Out +trait Inv +fun getT(): T = null!! + +trait Test { + fun parameters1(i: I, o: O, p: P) + fun parameters2(i: In<)!>I>) + fun parameters3(i: In) + + fun explicitReturnType1() : I + fun explicitReturnType2() : O + fun explicitReturnType3() : P + fun explicitReturnType4() : In + fun explicitReturnType5() : In<)!>O> + + fun imlicitReturnType1() = getT() + fun imlicitReturnType2() = getT() + fun imlicitReturnType3() = getT

() + fun imlicitReturnType4() = getT>() + )!>fun imlicitReturnType5() = getT>() + + fun I.receiver1() + fun O.receiver2() + fun P.receiver3() + fun In<)!>I>.receiver4() + fun In.receiver5() + + fun typeParameter1() + fun O> typeParameter2() + fun typeParameter3() + fun )!>I>> typeParameter4() + fun > typeParameter5() +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/variance/Function.txt b/compiler/testData/diagnostics/tests/variance/Function.txt new file mode 100644 index 00000000000..f8dc7da4737 --- /dev/null +++ b/compiler/testData/diagnostics/tests/variance/Function.txt @@ -0,0 +1,50 @@ +package + +internal fun getT(): T + +internal trait In { + 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 +} + +internal trait Inv { + 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 +} + +internal trait Out { + 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 +} + +internal trait Test { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + internal abstract fun explicitReturnType1(): I + internal abstract fun explicitReturnType2(): O + internal abstract fun explicitReturnType3(): P + internal abstract fun explicitReturnType4(): In + internal abstract fun explicitReturnType5(): In + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + internal open fun imlicitReturnType1(): I + internal open fun imlicitReturnType2(): O + internal open fun imlicitReturnType3(): P + internal open fun imlicitReturnType4(): In + internal open fun imlicitReturnType5(): In + internal abstract fun parameters1(/*0*/ i: I, /*1*/ o: O, /*2*/ p: P): kotlin.Unit + internal abstract fun parameters2(/*0*/ i: In): kotlin.Unit + internal abstract fun parameters3(/*0*/ i: In): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + internal abstract fun typeParameter1(): kotlin.Unit + internal abstract fun typeParameter2(): kotlin.Unit + internal abstract fun typeParameter3(): kotlin.Unit + internal abstract fun > typeParameter4(): kotlin.Unit + internal abstract fun > typeParameter5(): kotlin.Unit + internal abstract fun I.receiver1(): kotlin.Unit + internal abstract fun O.receiver2(): kotlin.Unit + internal abstract fun P.receiver3(): kotlin.Unit + internal abstract fun In.receiver4(): kotlin.Unit + internal abstract fun In.receiver5(): kotlin.Unit +} diff --git a/compiler/testData/diagnostics/tests/variance/InPosition.kt b/compiler/testData/diagnostics/tests/variance/InPosition.kt new file mode 100644 index 00000000000..403ee306bb0 --- /dev/null +++ b/compiler/testData/diagnostics/tests/variance/InPosition.kt @@ -0,0 +1,48 @@ +trait In +trait Out +trait Inv +trait Pair + +trait Test { + fun ok1(i: I) + fun ok2(i: In) + fun ok3(i: In>) + fun ok4(i: Inv

) + fun ok5(i: P) + fun ok6(i: Out) + fun ok7(i: Out>) + fun ok8(i: Out>) + fun ok9(i: Out>) + fun Ok10(i: I) + fun Ok11(i: In) + fun Ok12(i: In>) + fun Ok13(i: Out) + fun Ok14(i: Pair, I>) + fun Ok15(i: Inv) + + fun Ok20(i: Inv) + fun Ok21(i: Inv) + fun Ok22(i: Inv) + fun Ok23(i: Inv) + + fun neOk1(i: O) + fun neOk2(i: In<)!>I>) + fun neOk3(i: In>)!>O>>) + fun neOk4(i: Inv<)!>I>) + fun neOk5(i: Inv<)!>O>) + fun neOk6(i: In>)!>O>>) + fun neOk7(i: Pair, O>)!>I>, , O>)!>O>) + fun neOk8(i: Inv)!>O>) + fun neOk9(i: In<out P>) + fun neOk10(i: Out<)!>O>) + + fun neOk11(i: Inv)!>I>) + fun neOk12(i: Inv)!>O>) + + fun neOk30(i: Pair<)!>O, >) + fun neOk31(i: Pair<)!>O, Inv>) + fun neOk32(i: Inv) + fun neOk33(i: Inv<>) + fun neOk34(i: Inv<C>) + fun neOk35(i: Inv) +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/variance/InPosition.txt b/compiler/testData/diagnostics/tests/variance/InPosition.txt new file mode 100644 index 00000000000..b4eeeafd87f --- /dev/null +++ b/compiler/testData/diagnostics/tests/variance/InPosition.txt @@ -0,0 +1,68 @@ +package + +internal trait In { + 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 +} + +internal trait Inv { + 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 +} + +internal trait Out { + 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 +} + +internal trait Pair { + 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 +} + +internal trait Test { + internal abstract fun Ok10(/*0*/ i: I): kotlin.Unit + internal abstract fun Ok11(/*0*/ i: In): kotlin.Unit + internal abstract fun Ok12(/*0*/ i: In>): kotlin.Unit + internal abstract fun Ok13(/*0*/ i: Out): kotlin.Unit + internal abstract fun Ok14(/*0*/ i: Pair, I>): kotlin.Unit + internal abstract fun Ok15(/*0*/ i: Inv): kotlin.Unit + internal abstract fun Ok20(/*0*/ i: Inv): kotlin.Unit + internal abstract fun Ok21(/*0*/ i: Inv): kotlin.Unit + internal abstract fun Ok22(/*0*/ i: Inv): kotlin.Unit + internal abstract fun Ok23(/*0*/ i: Inv): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + internal abstract fun neOk1(/*0*/ i: O): kotlin.Unit + internal abstract fun neOk10(/*0*/ i: Out): kotlin.Unit + internal abstract fun neOk11(/*0*/ i: Inv): kotlin.Unit + internal abstract fun neOk12(/*0*/ i: Inv): kotlin.Unit + internal abstract fun neOk2(/*0*/ i: In): kotlin.Unit + internal abstract fun neOk3(/*0*/ i: In>): kotlin.Unit + internal abstract fun neOk30(/*0*/ i: Pair): kotlin.Unit + internal abstract fun neOk31(/*0*/ i: Pair): kotlin.Unit + internal abstract fun neOk32(/*0*/ i: [ERROR : Inv]): kotlin.Unit + internal abstract fun neOk33(/*0*/ i: Inv<[ERROR : No type element]>): kotlin.Unit + internal abstract fun neOk34(/*0*/ i: Inv<[ERROR : C]>): kotlin.Unit + internal abstract fun neOk35(/*0*/ i: [ERROR : Inv]): kotlin.Unit + internal abstract fun neOk4(/*0*/ i: Inv): kotlin.Unit + internal abstract fun neOk5(/*0*/ i: Inv): kotlin.Unit + internal abstract fun neOk6(/*0*/ i: In>): kotlin.Unit + internal abstract fun neOk7(/*0*/ i: Pair, O>): kotlin.Unit + internal abstract fun neOk8(/*0*/ i: Inv): kotlin.Unit + internal abstract fun neOk9(/*0*/ i: In): kotlin.Unit + internal abstract fun ok1(/*0*/ i: I): kotlin.Unit + internal abstract fun ok2(/*0*/ i: In): kotlin.Unit + internal abstract fun ok3(/*0*/ i: In>): kotlin.Unit + internal abstract fun ok4(/*0*/ i: Inv

): kotlin.Unit + internal abstract fun ok5(/*0*/ i: P): kotlin.Unit + internal abstract fun ok6(/*0*/ i: Out): kotlin.Unit + internal abstract fun ok7(/*0*/ i: Out>): kotlin.Unit + internal abstract fun ok8(/*0*/ i: Out>): kotlin.Unit + internal abstract fun ok9(/*0*/ i: Out>): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/tests/variance/InvariantPosition.kt b/compiler/testData/diagnostics/tests/variance/InvariantPosition.kt new file mode 100644 index 00000000000..96dd46da951 --- /dev/null +++ b/compiler/testData/diagnostics/tests/variance/InvariantPosition.kt @@ -0,0 +1,45 @@ +trait In +trait Out +trait Inv +trait Pair + +trait Test { + var ok1: Inv

+ var ok2: P + var ok3: Out> + var ok4: Pair, Out

> + var ok5: Inv + var ok6: Inv + var ok7: Inv + + var neOk1: O + var neOk2: In<)!>I> + var neOk3: In>)!>O>> + var neOk4: Inv<)!>I> + var neOk5: Inv<)!>O> + var neOk6: In>)!>O>> + var neOk7: Pair, O>)!>I>, , O>)!>O> + var neOk8: Inv)!>O> + var neOk9: Inv)!>I> + var neOk10: In<out I> + + var neOk11: I + var neOk12: In<)!>O> + var neOk13: In>)!>I>> + var neOk14: Out<)!>I> + var neOk15: Out>)!>I>> + var neOk16: Out>)!>O>> + var neOk17: Pair, I>)!>O>, , I>)!>I> + + var neOk20: Inv)!>O> + var neOk21: Inv)!>I> + var neOk22: Inv)!>O> + var neOk23: Inv)!>I> + + var neOk30: Pair<)!>I, > + var neOk31: Pair<)!>I, Inv> + var neOk32: Inv + var neOk33: Inv<> + var neOk34: Inv<C> + var neOk35: Inv +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/variance/InvariantPosition.txt b/compiler/testData/diagnostics/tests/variance/InvariantPosition.txt new file mode 100644 index 00000000000..2d726581961 --- /dev/null +++ b/compiler/testData/diagnostics/tests/variance/InvariantPosition.txt @@ -0,0 +1,65 @@ +package + +internal trait In { + 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 +} + +internal trait Inv { + 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 +} + +internal trait Out { + 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 +} + +internal trait Pair { + 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 +} + +internal trait Test { + internal abstract var neOk1: O + internal abstract var neOk10: In + internal abstract var neOk11: I + internal abstract var neOk12: In + internal abstract var neOk13: In> + internal abstract var neOk14: Out + internal abstract var neOk15: Out> + internal abstract var neOk16: Out> + internal abstract var neOk17: Pair, I> + internal abstract var neOk2: In + internal abstract var neOk20: Inv + internal abstract var neOk21: Inv + internal abstract var neOk22: Inv + internal abstract var neOk23: Inv + internal abstract var neOk3: In> + internal abstract var neOk30: Pair + internal abstract var neOk31: Pair + internal abstract var neOk32: [ERROR : Inv] + internal abstract var neOk33: Inv<[ERROR : No type element]> + internal abstract var neOk34: Inv<[ERROR : C]> + internal abstract var neOk35: [ERROR : Inv] + internal abstract var neOk4: Inv + internal abstract var neOk5: Inv + internal abstract var neOk6: In> + internal abstract var neOk7: Pair, O> + internal abstract var neOk8: Inv + internal abstract var neOk9: Inv + internal abstract var ok1: Inv

+ internal abstract var ok2: P + internal abstract var ok3: Out> + internal abstract var ok4: Pair, Out

> + internal abstract var ok5: Inv + internal abstract var ok6: Inv + internal abstract var ok7: Inv + 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/testData/diagnostics/tests/variance/OutPosition.kt b/compiler/testData/diagnostics/tests/variance/OutPosition.kt new file mode 100644 index 00000000000..e07933736fe --- /dev/null +++ b/compiler/testData/diagnostics/tests/variance/OutPosition.kt @@ -0,0 +1,40 @@ +trait In +trait Out +trait Inv +trait Pair + +trait Test { + fun ok1(): O + fun ok2(): In + fun ok3(): In> + fun ok4(): Inv

+ fun ok5(): P + fun ok6(): Out + fun ok7(): Out

+ fun ok8(): Out> + fun ok9(): Pair, O> + + fun ok10(): Inv + fun ok11(): Inv + fun ok12(): Inv + fun ok13(): Inv + + fun neOk1(): I + fun neOk2(): In<)!>O> + fun neOk3(): In>)!>I>> + fun neOk4(): Inv<)!>I> + fun neOk5(): Inv<)!>O> + fun neOk6(): Pair, I>)!>O>, , I>)!>I> + fun neOk7(): Inv)!>O> + fun neOk8(): Out<in I> + + fun neOk10(): Inv)!>O> + fun neOk11(): Inv)!>I> + + fun neOk30(): Pair<)!>I, > + fun neOk31(): Pair<)!>I, Inv> + fun neOk32(): Inv + fun neOk33(): Inv<> + fun neOk34(): Inv<C> + fun neOk35(): Inv +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/variance/OutPosition.txt b/compiler/testData/diagnostics/tests/variance/OutPosition.txt new file mode 100644 index 00000000000..edbf17fe02e --- /dev/null +++ b/compiler/testData/diagnostics/tests/variance/OutPosition.txt @@ -0,0 +1,60 @@ +package + +internal trait In { + 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 +} + +internal trait Inv { + 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 +} + +internal trait Out { + 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 +} + +internal trait Pair { + 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 +} + +internal trait Test { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + internal abstract fun neOk1(): I + internal abstract fun neOk10(): Inv + internal abstract fun neOk11(): Inv + internal abstract fun neOk2(): In + internal abstract fun neOk3(): In> + internal abstract fun neOk30(): Pair + internal abstract fun neOk31(): Pair + internal abstract fun neOk32(): [ERROR : Inv] + internal abstract fun neOk33(): Inv<[ERROR : No type element]> + internal abstract fun neOk34(): Inv<[ERROR : C]> + internal abstract fun neOk35(): [ERROR : Inv] + internal abstract fun neOk4(): Inv + internal abstract fun neOk5(): Inv + internal abstract fun neOk6(): Pair, I> + internal abstract fun neOk7(): Inv + internal abstract fun neOk8(): Out + internal abstract fun ok1(): O + internal abstract fun ok10(): Inv + internal abstract fun ok11(): Inv + internal abstract fun ok12(): Inv + internal abstract fun ok13(): Inv + internal abstract fun ok2(): In + internal abstract fun ok3(): In> + internal abstract fun ok4(): Inv

+ internal abstract fun ok5(): P + internal abstract fun ok6(): Out + internal abstract fun ok7(): Out

+ internal abstract fun ok8(): Out> + internal abstract fun ok9(): Pair, O> + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/tests/variance/PrimaryConstructor.kt b/compiler/testData/diagnostics/tests/variance/PrimaryConstructor.kt new file mode 100644 index 00000000000..9b5b945121b --- /dev/null +++ b/compiler/testData/diagnostics/tests/variance/PrimaryConstructor.kt @@ -0,0 +1,25 @@ +trait In +trait Out +trait Inv + +fun getT(): T = null!! + +class Test( + val type1: I, + val type2: O, + val type3: P, + val type4: In, + val type5: In<)!>O>, + + var type6: I, + var type7: O, + var type8: P, + var type9: In<)!>I>, + var type0: In<)!>O>, + + type11: I, + type12: O, + type13: P, + type14: In, + type15: In +) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/variance/PrimaryConstructor.txt b/compiler/testData/diagnostics/tests/variance/PrimaryConstructor.txt new file mode 100644 index 00000000000..4d4d856242b --- /dev/null +++ b/compiler/testData/diagnostics/tests/variance/PrimaryConstructor.txt @@ -0,0 +1,38 @@ +package + +internal fun getT(): T + +internal trait In { + 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 +} + +internal trait Inv { + 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 +} + +internal trait Out { + 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 +} + +internal final class Test { + public constructor Test(/*0*/ type1: I, /*1*/ type2: O, /*2*/ type3: P, /*3*/ type4: In, /*4*/ type5: In, /*5*/ type6: I, /*6*/ type7: O, /*7*/ type8: P, /*8*/ type9: In, /*9*/ type0: In, /*10*/ type11: I, /*11*/ type12: O, /*12*/ type13: P, /*13*/ type14: In, /*14*/ type15: In) + internal final var type0: In + internal final val type1: I + internal final val type2: O + internal final val type3: P + internal final val type4: In + internal final val type5: In + internal final var type6: I + internal final var type7: O + internal final var type8: P + internal final var type9: In + 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/testData/diagnostics/tests/variance/ValProperty.kt b/compiler/testData/diagnostics/tests/variance/ValProperty.kt new file mode 100644 index 00000000000..3fd60976a2b --- /dev/null +++ b/compiler/testData/diagnostics/tests/variance/ValProperty.kt @@ -0,0 +1,48 @@ +trait In +trait Out +trait Inv + +class Delegate { + fun get(t: Any, p: PropertyMetadata): T = null!! + fun set(t: Any, p: PropertyMetadata, value: T) {} +} + +fun getT(): T = null!! + +abstract class Test { + abstract val type1: I + abstract val type2: O + abstract val type3: P + abstract val type4: In + abstract val type5: In<)!>O> + + val implicitType1 = getT() + val implicitType2 = getT() + val implicitType3 = getT

() + val implicitType4 = getT>() + )!>val implicitType5 = getT>() + + val delegateType1 by Delegate() + val delegateType2 by Delegate() + val delegateType3 by Delegate

() + val delegateType4 by Delegate>() + )!>val delegateType5 by Delegate>() + + abstract val I.receiver1: Int + abstract val O.receiver2: Int + abstract val P.receiver3: Int + abstract val In<)!>I>.receiver4: Int + abstract val In.receiver5: Int + + val typeParameter1 = 8 + val O> typeParameter2 = 13 + val typeParameter3 = 21 + val )!>I>> typeParameter4 = 34 + val > typeParameter5 = 55 + + val typeParameter6 where X : I = 1 + val typeParameter7 where X : O = 1 + val typeParameter8 where X : P = 2 + val typeParameter9 where X : In<)!>I> = 3 + val typeParameter0 where X : In = 5 +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/variance/ValProperty.txt b/compiler/testData/diagnostics/tests/variance/ValProperty.txt new file mode 100644 index 00000000000..223f3a41f38 --- /dev/null +++ b/compiler/testData/diagnostics/tests/variance/ValProperty.txt @@ -0,0 +1,67 @@ +package + +internal fun getT(): T + +internal final class Delegate { + public constructor Delegate() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + internal final fun get(/*0*/ t: kotlin.Any, /*1*/ p: kotlin.PropertyMetadata): T + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + internal final fun set(/*0*/ t: kotlin.Any, /*1*/ p: kotlin.PropertyMetadata, /*2*/ value: T): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +internal trait In { + 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 +} + +internal trait Inv { + 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 +} + +internal trait Out { + 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 +} + +internal abstract class Test { + public constructor Test() + internal final val delegateType1: I + internal final val delegateType2: O + internal final val delegateType3: P + internal final val delegateType4: In + internal final val delegateType5: In + internal final val implicitType1: I + internal final val implicitType2: O + internal final val implicitType3: P + internal final val implicitType4: In + internal final val implicitType5: In + internal abstract val type1: I + internal abstract val type2: O + internal abstract val type3: P + internal abstract val type4: In + internal abstract val type5: In + internal final val > typeParameter0: kotlin.Int = 5 + internal final val typeParameter1: kotlin.Int = 8 + internal final val typeParameter2: kotlin.Int = 13 + internal final val typeParameter3: kotlin.Int = 21 + internal final val > typeParameter4: kotlin.Int = 34 + internal final val > typeParameter5: kotlin.Int = 55 + internal final val typeParameter6: kotlin.Int = 1 + internal final val typeParameter7: kotlin.Int = 1 + internal final val typeParameter8: kotlin.Int = 2 + internal final val > typeParameter9: kotlin.Int = 3 + internal abstract val I.receiver1: kotlin.Int + internal abstract val O.receiver2: kotlin.Int + internal abstract val P.receiver3: kotlin.Int + internal abstract val In.receiver4: kotlin.Int + internal abstract val In.receiver5: kotlin.Int + 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/testData/diagnostics/tests/variance/VarProperty.kt b/compiler/testData/diagnostics/tests/variance/VarProperty.kt new file mode 100644 index 00000000000..b2cd1b7f5bc --- /dev/null +++ b/compiler/testData/diagnostics/tests/variance/VarProperty.kt @@ -0,0 +1,48 @@ +trait In +trait Out +trait Inv + +class Delegate { + fun get(t: Any, p: PropertyMetadata): T = null!! + fun set(t: Any, p: PropertyMetadata, varue: T) {} +} + +fun getT(): T = null!! + +abstract class Test { + abstract var type1: I + abstract var type2: O + abstract var type3: P + abstract var type4: In<)!>I> + abstract var type5: In<)!>O> + + var implicitType1 = getT() + var implicitType2 = getT() + var implicitType3 = getT

() + )!>var implicitType4 = getT>() + )!>var implicitType5 = getT>() + + var delegateType1 by Delegate() + var delegateType2 by Delegate() + var delegateType3 by Delegate

() + )!>var delegateType4 by Delegate>() + )!>var delegateType5 by Delegate>() + + abstract var I.receiver1: Int + abstract var O.receiver2: Int + abstract var P.receiver3: Int + abstract var In<)!>I>.receiver4: Int + abstract var In.receiver5: Int + + var typeParameter1 = 8 + var O> typeParameter2 = 13 + var typeParameter3 = 21 + var )!>I>> typeParameter4 = 34 + var > typeParameter5 = 55 + + var typeParameter6 where X : I = 1 + var typeParameter7 where X : O = 1 + var typeParameter8 where X : P = 2 + var typeParameter9 where X : In<)!>I> = 3 + var typeParameter0 where X : In = 5 +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/variance/VarProperty.txt b/compiler/testData/diagnostics/tests/variance/VarProperty.txt new file mode 100644 index 00000000000..1447ada8c8a --- /dev/null +++ b/compiler/testData/diagnostics/tests/variance/VarProperty.txt @@ -0,0 +1,67 @@ +package + +internal fun getT(): T + +internal final class Delegate { + public constructor Delegate() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + internal final fun get(/*0*/ t: kotlin.Any, /*1*/ p: kotlin.PropertyMetadata): T + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + internal final fun set(/*0*/ t: kotlin.Any, /*1*/ p: kotlin.PropertyMetadata, /*2*/ varue: T): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +internal trait In { + 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 +} + +internal trait Inv { + 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 +} + +internal trait Out { + 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 +} + +internal abstract class Test { + public constructor Test() + internal final var delegateType1: I + internal final var delegateType2: O + internal final var delegateType3: P + internal final var delegateType4: In + internal final var delegateType5: In + internal final var implicitType1: I + internal final var implicitType2: O + internal final var implicitType3: P + internal final var implicitType4: In + internal final var implicitType5: In + internal abstract var type1: I + internal abstract var type2: O + internal abstract var type3: P + internal abstract var type4: In + internal abstract var type5: In + internal final var > typeParameter0: kotlin.Int + internal final var typeParameter1: kotlin.Int + internal final var typeParameter2: kotlin.Int + internal final var typeParameter3: kotlin.Int + internal final var > typeParameter4: kotlin.Int + internal final var > typeParameter5: kotlin.Int + internal final var typeParameter6: kotlin.Int + internal final var typeParameter7: kotlin.Int + internal final var typeParameter8: kotlin.Int + internal final var > typeParameter9: kotlin.Int + internal abstract var I.receiver1: kotlin.Int + internal abstract var O.receiver2: kotlin.Int + internal abstract var P.receiver3: kotlin.Int + internal abstract var In.receiver4: kotlin.Int + internal abstract var In.receiver5: kotlin.Int + 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/testData/diagnostics/tests/variance/Visibility.kt b/compiler/testData/diagnostics/tests/variance/Visibility.kt new file mode 100644 index 00000000000..cee2c4a1b72 --- /dev/null +++ b/compiler/testData/diagnostics/tests/variance/Visibility.kt @@ -0,0 +1,20 @@ +trait Test { + val internal_val: I + public val public_val: I + protected val protected_val: I + private val private_val: I + + var interlan_private_set: O + private set + public var public_private_set: O + private set + protected var protected_private_set: O + private set + private var private_private_set: O + private set + + fun internal_fun(i: O) : I + public fun public_fun(i: O) : I + protected fun protected_fun(i: O) : I + private fun private_fun(i: O) : I +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/variance/Visibility.txt b/compiler/testData/diagnostics/tests/variance/Visibility.txt new file mode 100644 index 00000000000..72abc376965 --- /dev/null +++ b/compiler/testData/diagnostics/tests/variance/Visibility.txt @@ -0,0 +1,19 @@ +package + +internal trait Test { + internal abstract var interlan_private_set: O + internal abstract val internal_val: I + private abstract var private_private_set: O + private abstract val private_val: I + protected abstract var protected_private_set: O + protected abstract val protected_val: I + public abstract var public_private_set: O + public abstract val public_val: I + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + internal abstract fun internal_fun(/*0*/ i: O): I + private abstract fun private_fun(/*0*/ i: O): I + protected abstract fun protected_fun(/*0*/ i: O): I + public abstract fun public_fun(/*0*/ i: O): I + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java index 01921cf97c8..1a1f2a18e4f 100644 --- a/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java @@ -33,7 +33,7 @@ import java.util.regex.Pattern; public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest { @TestMetadata("compiler/testData/diagnostics/tests") @TestDataPath("$PROJECT_ROOT") - @InnerTestClasses({Tests.Annotations.class, Tests.BackingField.class, Tests.Cast.class, Tests.CheckArguments.class, Tests.ClassObjects.class, Tests.ControlFlowAnalysis.class, Tests.ControlStructures.class, Tests.CyclicHierarchy.class, Tests.DataClasses.class, Tests.DataFlow.class, Tests.DataFlowInfoTraversal.class, Tests.DeclarationChecks.class, Tests.DelegatedProperty.class, Tests.Delegation.class, Tests.Deparenthesize.class, Tests.DuplicateJvmSignature.class, Tests.DynamicTypes.class, Tests.Enum.class, Tests.Evaluate.class, Tests.Extensions.class, Tests.FunctionLiterals.class, Tests.Generics.class, Tests.Imports.class, Tests.IncompleteCode.class, Tests.Inference.class, Tests.Infos.class, Tests.Inline.class, Tests.Inner.class, Tests.J_k.class, Tests.Jdk_annotations.class, Tests.Labels.class, Tests.Library.class, Tests.Multimodule.class, Tests.NamedArguments.class, Tests.NullabilityAndSmartCasts.class, Tests.NullableTypes.class, Tests.Numbers.class, Tests.Objects.class, Tests.OperatorsOverloading.class, Tests.Overload.class, Tests.Override.class, Tests.PlatformTypes.class, Tests.Recovery.class, Tests.Redeclarations.class, Tests.Regressions.class, Tests.Resolve.class, Tests.Scopes.class, Tests.SenselessComparison.class, Tests.Shadowing.class, Tests.SmartCasts.class, Tests.Substitutions.class, Tests.Subtyping.class, Tests.Suppress.class, Tests.ThisAndSuper.class, Tests.TraitWithRequired.class, Tests.Typedefs.class, Tests.Unit.class, Tests.Varargs.class, Tests.When.class}) + @InnerTestClasses({Tests.Annotations.class, Tests.BackingField.class, Tests.Cast.class, Tests.CheckArguments.class, Tests.ClassObjects.class, Tests.ControlFlowAnalysis.class, Tests.ControlStructures.class, Tests.CyclicHierarchy.class, Tests.DataClasses.class, Tests.DataFlow.class, Tests.DataFlowInfoTraversal.class, Tests.DeclarationChecks.class, Tests.DelegatedProperty.class, Tests.Delegation.class, Tests.Deparenthesize.class, Tests.DuplicateJvmSignature.class, Tests.DynamicTypes.class, Tests.Enum.class, Tests.Evaluate.class, Tests.Extensions.class, Tests.FunctionLiterals.class, Tests.Generics.class, Tests.Imports.class, Tests.IncompleteCode.class, Tests.Inference.class, Tests.Infos.class, Tests.Inline.class, Tests.Inner.class, Tests.J_k.class, Tests.Jdk_annotations.class, Tests.Labels.class, Tests.Library.class, Tests.Multimodule.class, Tests.NamedArguments.class, Tests.NullabilityAndSmartCasts.class, Tests.NullableTypes.class, Tests.Numbers.class, Tests.Objects.class, Tests.OperatorsOverloading.class, Tests.Overload.class, Tests.Override.class, Tests.PlatformTypes.class, Tests.Recovery.class, Tests.Redeclarations.class, Tests.Regressions.class, Tests.Resolve.class, Tests.Scopes.class, Tests.SenselessComparison.class, Tests.Shadowing.class, Tests.SmartCasts.class, Tests.Substitutions.class, Tests.Subtyping.class, Tests.Suppress.class, Tests.ThisAndSuper.class, Tests.TraitWithRequired.class, Tests.Typedefs.class, Tests.Unit.class, Tests.Varargs.class, Tests.Variance.class, Tests.When.class}) @RunWith(JUnit3RunnerWithInners.class) public static class Tests extends AbstractJetDiagnosticsTest { @TestMetadata("Abstract.kt") @@ -10212,6 +10212,69 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest { } } + @TestMetadata("compiler/testData/diagnostics/tests/variance") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Variance extends AbstractJetDiagnosticsTest { + public void testAllFilesPresentInVariance() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/tests/variance"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("Class.kt") + public void testClass() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/variance/Class.kt"); + doTest(fileName); + } + + @TestMetadata("Function.kt") + public void testFunction() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/variance/Function.kt"); + doTest(fileName); + } + + @TestMetadata("InPosition.kt") + public void testInPosition() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/variance/InPosition.kt"); + doTest(fileName); + } + + @TestMetadata("InvariantPosition.kt") + public void testInvariantPosition() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/variance/InvariantPosition.kt"); + doTest(fileName); + } + + @TestMetadata("OutPosition.kt") + public void testOutPosition() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/variance/OutPosition.kt"); + doTest(fileName); + } + + @TestMetadata("PrimaryConstructor.kt") + public void testPrimaryConstructor() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/variance/PrimaryConstructor.kt"); + doTest(fileName); + } + + @TestMetadata("ValProperty.kt") + public void testValProperty() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/variance/ValProperty.kt"); + doTest(fileName); + } + + @TestMetadata("VarProperty.kt") + public void testVarProperty() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/variance/VarProperty.kt"); + doTest(fileName); + } + + @TestMetadata("Visibility.kt") + public void testVisibility() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/variance/Visibility.kt"); + doTest(fileName); + } + } + @TestMetadata("compiler/testData/diagnostics/tests/when") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class)