[FIR] UPPER_BOUND_VIOLATED optimizations

This commit is contained in:
Nick
2020-07-13 10:11:58 +03:00
committed by Mikhail Glukhikh
parent 41a0cfe002
commit 1ea5678932
3 changed files with 85 additions and 31 deletions
@@ -13,6 +13,9 @@ fun <T : A> fest() {
fun test() {
val b1 = B<<!UPPER_BOUND_VIOLATED!>Int<!>>()
val b2 = B<C>()
val b3 = B<<!UPPER_BOUND_VIOLATED!>Any?<!>>()
val b4 = B<UnexistingType>()
val b5 = B<<!UPPER_BOUND_VIOLATED!>B<UnexistingType><!>>()
fest<<!UPPER_BOUND_VIOLATED!>Boolean<!>>()
fest<C>()
fest<HHH>()
@@ -38,4 +41,8 @@ fun <K, L : K> rest() {
class NumColl<T : Collection<Number>>
typealias NL<K> = NumColl<List<K>>
val test7 = NL<Int>()
val test8 = <!UPPER_BOUND_VIOLATED!>NL<String>()<!>
val test8 = <!UPPER_BOUND_VIOLATED!>NL<String>()<!>
class NumberPhile<T: Number>(x: T)
val np1 = NumberPhile(10)
val np2 = <!INAPPLICABLE_CANDIDATE!>NumberPhile<!>("Test")
@@ -21,6 +21,9 @@ FILE: upperBoundViolated.kt
public final fun test(): R|kotlin/Unit| {
lval b1: R|B<kotlin/Int>| = R|/B.B|<R|kotlin/Int|>()
lval b2: R|B<C>| = R|/B.B|<R|C|>()
lval b3: R|B<kotlin/Any?>| = R|/B.B|<R|kotlin/Any?|>()
lval b4: R|B<A>| = R|/B.B|<R|A|>()
lval b5: R|B<B<ERROR CLASS: Symbol not found, for `UnexistingType`>>| = R|/B.B|<R|B<ERROR CLASS: Symbol not found, for `UnexistingType`>|>()
R|/fest|<R|kotlin/Boolean|>()
R|/fest|<R|C|>()
R|/fest|<R|C|>()
@@ -59,3 +62,13 @@ FILE: upperBoundViolated.kt
public get(): R|NumColl<kotlin/collections/List<kotlin/Int>>|
public final val test8: R|NumColl<kotlin/collections/List<kotlin/String>>| = R|/NumColl.NumColl|<R|kotlin/String|>()
public get(): R|NumColl<kotlin/collections/List<kotlin/String>>|
public final class NumberPhile<T : R|kotlin/Number|> : R|kotlin/Any| {
public constructor<T : R|kotlin/Number|>(x: R|T|): R|NumberPhile<T>| {
super<R|kotlin/Any|>()
}
}
public final val np1: R|NumberPhile<kotlin/Int>| = R|/NumberPhile.NumberPhile|<R|kotlin/Int|>(Int(10))
public get(): R|NumberPhile<kotlin/Int>|
public final val np2: <ERROR TYPE REF: Inapplicable(INAPPLICABLE): [/NumberPhile.NumberPhile]> = <Inapplicable(INAPPLICABLE): [/NumberPhile.NumberPhile]>#(String(Test))
public get(): <ERROR TYPE REF: Inapplicable(INAPPLICABLE): [/NumberPhile.NumberPhile]>