[FIR] Implement REDUNDANT_PROJECTION diagnostics, rename FirConflictingProjectionChecker -> FirProjectionRelationChecker, fix tests
This commit is contained in:
committed by
teamcityserver
parent
03e577bf98
commit
f081a6b4fa
Vendored
-20
@@ -1,20 +0,0 @@
|
||||
class In<in T>
|
||||
class Out<out T>
|
||||
class Inv<T>
|
||||
class X
|
||||
|
||||
fun f1(p: In<in X>) {}
|
||||
fun f2(p: In<<!CONFLICTING_PROJECTION!>out<!> X>) {}
|
||||
fun f3(p: In<X>) {}
|
||||
|
||||
fun f4(p: Out<out X>) {}
|
||||
fun f5(p: Out<<!CONFLICTING_PROJECTION!>in<!> X>) {}
|
||||
fun f6(p: Out<X>) {}
|
||||
|
||||
fun f6(p: Inv<X>) {}
|
||||
fun f7(p: Inv<in X>) {}
|
||||
fun f8(p: Inv<out X>) {}
|
||||
|
||||
fun f9(p: In<*>) {}
|
||||
fun f10(p: Out<*>) {}
|
||||
fun f11(p: Inv<*>) {}
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
class In<in T>
|
||||
class Out<out T>
|
||||
class Inv<T>
|
||||
|
||||
+3
-3
@@ -2,11 +2,11 @@ typealias Action<K> = (@UnsafeVariance K) -> Unit
|
||||
typealias Action2<K> = (@UnsafeVariance K) -> K
|
||||
|
||||
data class Tag<L>(val action: Action<L>)
|
||||
data class Tag2<L>(val action: Action<in L>)
|
||||
data class Tag2<L>(val action: Action<<!REDUNDANT_PROJECTION!>in<!> L>)
|
||||
data class Tag3<in L>(val action: Action<L>)
|
||||
data class Tag4<in L>(val action: Action<in L>)
|
||||
data class Tag4<in L>(val action: Action<<!REDUNDANT_PROJECTION!>in<!> L>)
|
||||
data class Tag5<L>(val action: Action2<L>)
|
||||
data class Tag6<out L>(val action: Action<in L>)
|
||||
data class Tag6<out L>(val action: Action<<!REDUNDANT_PROJECTION!>in<!> L>)
|
||||
data class Tag7<out L>(val action: Action<L>)
|
||||
data class Tag8<out L>(val action: Action2<L>)
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ fun foo() : G<Point> {
|
||||
|
||||
class Out<out T>() {}
|
||||
|
||||
fun <T> fout(expression : T) : Out<out T> = Out<T>()
|
||||
fun <T> fout(expression : T) : Out<<!REDUNDANT_PROJECTION!>out<!> T> = Out<T>()
|
||||
|
||||
fun fooout() : Out<Point> {
|
||||
val p = Point();
|
||||
|
||||
@@ -5,13 +5,13 @@ class Out<out T>
|
||||
class Inv<T>
|
||||
|
||||
typealias In1<T> = In<T>
|
||||
typealias In2<T> = In<in T>
|
||||
typealias In2<T> = In<<!REDUNDANT_PROJECTION!>in<!> T>
|
||||
typealias In3<T> = In<<!CONFLICTING_PROJECTION!>out<!> T>
|
||||
typealias In4<T> = In<*>
|
||||
|
||||
typealias Out1<T> = Out<T>
|
||||
typealias Out2<T> = Out<<!CONFLICTING_PROJECTION!>in<!> T>
|
||||
typealias Out3<T> = Out<out T>
|
||||
typealias Out3<T> = Out<<!REDUNDANT_PROJECTION!>out<!> T>
|
||||
typealias Out4<T> = Out<*>
|
||||
|
||||
typealias Inv1<T> = Inv<T>
|
||||
@@ -22,12 +22,12 @@ typealias Inv4<T> = Inv<*>
|
||||
val inv1: Inv1<Int> = Inv<Int>()
|
||||
|
||||
fun inInv_Inv(x: In1<Int>) = x
|
||||
fun inInv_In(x: In1<in Int>) = x
|
||||
fun inInv_In(x: In1<<!REDUNDANT_PROJECTION!>in<!> Int>) = x
|
||||
fun inInv_Out(x: In1<<!CONFLICTING_PROJECTION_IN_TYPEALIAS_EXPANSION!>out<!> Int>) = x
|
||||
fun inInv_Star(x: In1<*>) = x
|
||||
|
||||
fun inIn_Inv(x: In2<Int>) = x
|
||||
fun inIn_In(x: In2<in Int>) = x
|
||||
fun inIn_In(x: In2<<!REDUNDANT_PROJECTION!>in<!> Int>) = x
|
||||
fun inIn_Out(x: In2<<!CONFLICTING_PROJECTION_IN_TYPEALIAS_EXPANSION!>out<!> Int>) = x
|
||||
fun inIn_Star(x: In2<*>) = x
|
||||
|
||||
@@ -38,7 +38,7 @@ fun inOut_Star(x: In3<*>) = x
|
||||
|
||||
fun outInv_Inv(x: Out1<Int>) = x
|
||||
fun outInv_In(x: Out1<<!CONFLICTING_PROJECTION_IN_TYPEALIAS_EXPANSION!>in<!> Int>) = x
|
||||
fun outInv_Out(x: Out1<out Int>) = x
|
||||
fun outInv_Out(x: Out1<<!REDUNDANT_PROJECTION!>out<!> Int>) = x
|
||||
fun outInv_Star(x: Out1<*>) = x
|
||||
|
||||
fun outIn_Inv(x: Out2<Int>) = x
|
||||
@@ -48,7 +48,7 @@ fun outIn_Star(x: Out2<*>) = x
|
||||
|
||||
fun outOut_Inv(x: Out3<Int>) = x
|
||||
fun outOut_In(x: Out3<<!CONFLICTING_PROJECTION_IN_TYPEALIAS_EXPANSION!>in<!> Int>) = x
|
||||
fun outOut_Out(x: Out3<out Int>) = x
|
||||
fun outOut_Out(x: Out3<<!REDUNDANT_PROJECTION!>out<!> Int>) = x
|
||||
fun outOut_Star(x: Out3<*>) = x
|
||||
|
||||
fun invInv_Inv(x: Inv1<Int>) = x
|
||||
|
||||
Vendored
+4
-4
@@ -8,11 +8,11 @@ typealias InvOut = Inv<out Int>
|
||||
typealias InvT<T> = Inv<T>
|
||||
|
||||
typealias OutStar = Out<*>
|
||||
typealias OutOut = Out<out Int>
|
||||
typealias OutOut = Out<<!REDUNDANT_PROJECTION!>out<!> Int>
|
||||
typealias OutT<T> = Out<T>
|
||||
|
||||
typealias InStar = In<*>
|
||||
typealias InIn = In<in Int>
|
||||
typealias InIn = In<<!REDUNDANT_PROJECTION!>in<!> Int>
|
||||
typealias InT<T> = In<T>
|
||||
|
||||
class Test1 : InvStar
|
||||
@@ -24,9 +24,9 @@ class Test5 : InvT<InvT<*>>
|
||||
class Test6 : OutStar
|
||||
class Test7 : OutOut
|
||||
class Test8 : OutT<Int>
|
||||
class Test9 : OutT<out Int>
|
||||
class Test9 : OutT<<!REDUNDANT_PROJECTION!>out<!> Int>
|
||||
|
||||
class Test10 : InStar
|
||||
class Test11 : InIn
|
||||
class Test12 : InT<Int>
|
||||
class Test13 : InT<in Int>
|
||||
class Test13 : InT<<!REDUNDANT_PROJECTION!>in<!> Int>
|
||||
|
||||
Reference in New Issue
Block a user