[FIR] Report UPPER_BOUND_VIOLATED only on checkers stage, fix detection of missing cases and testData

This commit is contained in:
Ivan Kochurkin
2021-06-09 18:31:48 +03:00
committed by teamcityserver
parent ada14413e0
commit 5741374883
46 changed files with 203 additions and 208 deletions
@@ -45,7 +45,7 @@ class Foo() {}
class Bar<T : <!FINAL_UPPER_BOUND!>Foo<!>>
class Buzz<T> where T : <!FINAL_UPPER_BOUND!>Bar<Int><!>, T : <!UNRESOLVED_REFERENCE!>nioho<!>
class Buzz<T> where T : <!FINAL_UPPER_BOUND!>Bar<<!UPPER_BOUND_VIOLATED!>Int<!>><!>, T : <!UNRESOLVED_REFERENCE!>nioho<!>
class X<T : <!FINAL_UPPER_BOUND!>Foo<!>>
class Y<<!CONFLICTING_UPPER_BOUNDS!>T<!>> where T : <!FINAL_UPPER_BOUND!>Foo<!>, T : <!FINAL_UPPER_BOUND, ONLY_ONE_CLASS_BOUND_ALLOWED!>Bar<Foo><!>
@@ -62,8 +62,8 @@ fun <T> test2(t : T)
t.bar()
}
val t1 = test2<A>(<!ARGUMENT_TYPE_MISMATCH!>A()<!>)
val t2 = test2<B>(<!ARGUMENT_TYPE_MISMATCH!>C()<!>)
val t1 = test2<<!UPPER_BOUND_VIOLATED!>A<!>>(<!ARGUMENT_TYPE_MISMATCH!>A()<!>)
val t2 = test2<<!UPPER_BOUND_VIOLATED!>B<!>>(<!ARGUMENT_TYPE_MISMATCH!>C()<!>)
val t3 = test2<C>(C())
val <<!TYPE_PARAMETER_OF_PROPERTY_NOT_USED_IN_RECEIVER!>T<!>, <!TYPE_PARAMETER_OF_PROPERTY_NOT_USED_IN_RECEIVER!>B : T<!>> x : Int = 0
@@ -26,7 +26,7 @@ class G<E : <!FINAL_UPPER_BOUND!>Double<!>>(val balue: E) : F<E>(balue) {
override var rest: E = balue
}
class H<E : <!FINAL_UPPER_BOUND!>String<!>>(val balue: E) : F<E>(<!ARGUMENT_TYPE_MISMATCH!>balue<!>) {
class H<E : <!FINAL_UPPER_BOUND!>String<!>>(val balue: E) : F<<!UPPER_BOUND_VIOLATED!>E<!>>(<!ARGUMENT_TYPE_MISMATCH!>balue<!>) {
override var rest: E = balue // no report because of INAPPLICABLE_CANDIDATE
}
@@ -27,7 +27,7 @@ class G<E : <!FINAL_UPPER_BOUND!>Double<!>>(val balue: E) : F<E>(balue) {
override fun rest(): E = balue
}
class H<E : <!FINAL_UPPER_BOUND!>String<!>>(val balue: E) : F<E>(<!ARGUMENT_TYPE_MISMATCH!>balue<!>) {
class H<E : <!FINAL_UPPER_BOUND!>String<!>>(val balue: E) : F<<!UPPER_BOUND_VIOLATED!>E<!>>(<!ARGUMENT_TYPE_MISMATCH!>balue<!>) {
override fun rest(): E = balue // no report because of INAPPLICABLE_CANDIDATE
}
@@ -41,14 +41,14 @@ FILE: upperBoundViolated.kt
}
}
public final class P<T> : R|kotlin/Any| {
public constructor<T>(): R|P<T>| {
public final class P<T0 : R|kotlin/Number|, T1> : R|kotlin/Any| {
public constructor<T0 : R|kotlin/Number|, T1>(): R|P<T0, T1>| {
super<R|kotlin/Any|>()
}
}
public final class P1<T1 : R|kotlin/Number|, T2 : R|kotlin/Number|> : R|kotlin/Any| {
public constructor<T1 : R|kotlin/Number|, T2 : R|kotlin/Number|>(): R|P1<T1, T2>| {
public final class P1<T2 : R|kotlin/Number|, T3 : R|kotlin/Number|> : R|kotlin/Any| {
public constructor<T2 : R|kotlin/Number|, T3 : R|kotlin/Number|>(): R|P1<T2, T3>| {
super<R|kotlin/Any|>()
}
@@ -62,7 +62,7 @@ FILE: upperBoundViolated.kt
lval o5: R|S<S<L, L>, T<K, L>>| = <CS errors: /S.S>#<R|S<L, L>|, R|T<K, L>|>()
lval o6: R|S<kotlin/Any, T<S<K, L>, kotlin/String>>| = R|/S.S|<R|kotlin/Any|, R|T<S<K, L>, kotlin/String>|>()
lval o7: R|S<kotlin/Any, T<S<K, L>, kotlin/Nothing>>| = R|/S.S|<R|kotlin/Any|, R|T<S<K, L>, kotlin/Nothing>|>()
lval o8: R|P<P1<kotlin/String, kotlin/String>>| = R|/P.P|<R|P1<kotlin/String, kotlin/String>|>()
lval o8: R|P<kotlin/String, P1<kotlin/String, kotlin/String>>| = <CS errors: /P.P>#<R|kotlin/String|, R|P1<kotlin/String, kotlin/String>|>()
}
public final class NumColl<T : R|kotlin/collections/Collection<kotlin/Number>|> : R|kotlin/Any| {
public constructor<T : R|kotlin/collections/Collection<kotlin/Number>|>(): R|NumColl<T>| {
@@ -24,8 +24,8 @@ fun test() {
open class S<F, G : F>
class T<U, Y : U> : S<U, Y>()
class P<T>
class P1<T1: Number, T2: Number>
class P<T0: Number, T1>
class P1<T2 : Number, T3 : Number>
fun <K, L : K> rest() {
@@ -39,7 +39,7 @@ fun <K, L : K> rest() {
val o6 = S<Any, T<S<K, L>, <!UPPER_BOUND_VIOLATED!>String<!>>>()
val o7 = S<Any, T<S<K, L>, Nothing>>()
val o8 = P<P1<<!UPPER_BOUND_VIOLATED!>String<!>, <!UPPER_BOUND_VIOLATED!>String<!>>>()
val o8 = P<<!UPPER_BOUND_VIOLATED!>String<!>, P1<<!UPPER_BOUND_VIOLATED!>String<!>, <!UPPER_BOUND_VIOLATED!>String<!>>>()
}
class NumColl<T : Collection<Number>>