FE: add new tests around unresolved integer literals
Related to KT-57487, KT-57703
This commit is contained in:
committed by
Space Team
parent
70c5978add
commit
27c4a7b7ef
@@ -0,0 +1,17 @@
|
||||
// FIR_DUMP
|
||||
|
||||
fun <A : Comparable<A>> arrayData(vararg values: A): A = null!!
|
||||
|
||||
fun <A> arrayDataNoBound(vararg values: A): A = null!!
|
||||
|
||||
fun test(b: Byte) {
|
||||
select(arrayData(1), b)
|
||||
select(id(1), b)
|
||||
select(id(arrayData(1)), b)
|
||||
select(arrayDataNoBound(1), b)
|
||||
}
|
||||
|
||||
fun <S> select(a: S, b: S) = a
|
||||
|
||||
fun <I : Comparable<I>> id(arg: I) = arg
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
FILE: vararg.fir.kt
|
||||
public final fun <A : R|kotlin/Comparable<A>|> arrayData(vararg values: R|kotlin/Array<out A>|): R|A| {
|
||||
^arrayData Null(null)!!
|
||||
}
|
||||
public final fun <A> arrayDataNoBound(vararg values: R|kotlin/Array<out A>|): R|A| {
|
||||
^arrayDataNoBound Null(null)!!
|
||||
}
|
||||
public final fun test(b: R|kotlin/Byte|): R|kotlin/Unit| {
|
||||
R|/select|<R|kotlin/Byte|>(R|/arrayData|<R|kotlin/Int|>(vararg(Int(1))), R|<local>/b|)
|
||||
R|/select|<R|kotlin/Byte|>(R|/id|<R|kotlin/Int|>(Int(1)), R|<local>/b|)
|
||||
R|/select|<R|kotlin/Byte|>(R|/id|<R|kotlin/Int|>(R|/arrayData|<R|kotlin/Int|>(vararg(Int(1)))), R|<local>/b|)
|
||||
R|/select|<R|kotlin/Byte|>(R|/arrayDataNoBound|<R|kotlin/Byte|>(vararg(Byte(1))), R|<local>/b|)
|
||||
}
|
||||
public final fun <S> select(a: R|S|, b: R|S|): R|S| {
|
||||
^select R|<local>/a|
|
||||
}
|
||||
public final fun <I : R|kotlin/Comparable<I>|> id(arg: R|I|): R|I| {
|
||||
^id R|<local>/arg|
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// FIR_DUMP
|
||||
|
||||
fun <A : Comparable<A>> arrayData(vararg values: A): A = null!!
|
||||
|
||||
fun <A> arrayDataNoBound(vararg values: A): A = null!!
|
||||
|
||||
fun test(b: Byte) {
|
||||
select(<!TYPE_MISMATCH!>arrayData(1)<!>, b)
|
||||
select(<!TYPE_MISMATCH!>id(1)<!>, b)
|
||||
select(<!TYPE_MISMATCH!>id(arrayData(1))<!>, b)
|
||||
select(arrayDataNoBound(1), b)
|
||||
}
|
||||
|
||||
fun <S> select(a: S, b: S) = a
|
||||
|
||||
fun <I : Comparable<I>> id(arg: I) = arg
|
||||
Reference in New Issue
Block a user