[FIR] Fix location of UPPER_BOUND_VIOLATED, fix detecting of several diagnostics, simplify FirUpperBoundViolatedChecker.kt

This commit is contained in:
Ivan Kochurkin
2021-06-08 17:52:02 +03:00
committed by teamcityserver
parent 1298ba431b
commit ada14413e0
4 changed files with 101 additions and 202 deletions
@@ -40,6 +40,18 @@ FILE: upperBoundViolated.kt
super<R|S<U, Y>|>()
}
}
public final class P<T> : R|kotlin/Any| {
public constructor<T>(): R|P<T>| {
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>| {
super<R|kotlin/Any|>()
}
}
public final fun <K, L : R|K|> rest(): R|kotlin/Unit| {
lval o1: R|S<K, L>| = R|/S.S|<R|K|, R|L|>()
@@ -50,6 +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>|>()
}
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,6 +24,9 @@ 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>
fun <K, L : K> rest() {
val o1 = S<K, L>()
@@ -34,8 +37,9 @@ fun <K, L : K> rest() {
val o5 = S<S<K, L>, <!UPPER_BOUND_VIOLATED!>T<K, K><!>>()
val o5 = S<S<L, L>, <!UPPER_BOUND_VIOLATED!>T<K, L><!>>()
val o6 = S<Any, <!UPPER_BOUND_VIOLATED!>T<S<K, L>, String><!>>()
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<!>>>()
}
class NumColl<T : Collection<Number>>