[FIR] Add nullability to ILT. #KT-37639 Fixed
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
||||
// ISSUE: KT-37639
|
||||
|
||||
fun takeInt(x: Int) {}
|
||||
|
||||
fun test_1(b: Boolean) {
|
||||
val x = if (b) 1 else null
|
||||
<!INAPPLICABLE_CANDIDATE!>takeInt<!>(x)
|
||||
}
|
||||
|
||||
fun test_2(b: Boolean, y: Int) {
|
||||
val x = if (b) y else null
|
||||
<!INAPPLICABLE_CANDIDATE!>takeInt<!>(x)
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
FILE: nullableIntegerLiteralType.kt
|
||||
public final fun takeInt(x: R|kotlin/Int|): R|kotlin/Unit| {
|
||||
}
|
||||
public final fun test_1(b: R|kotlin/Boolean|): R|kotlin/Unit| {
|
||||
lval x: R|kotlin/Int?| = when () {
|
||||
R|<local>/b| -> {
|
||||
Int(1)
|
||||
}
|
||||
else -> {
|
||||
Null(null)
|
||||
}
|
||||
}
|
||||
|
||||
<Inapplicable(INAPPLICABLE): [/takeInt]>#(R|<local>/x|)
|
||||
}
|
||||
public final fun test_2(b: R|kotlin/Boolean|, y: R|kotlin/Int|): R|kotlin/Unit| {
|
||||
lval x: R|kotlin/Int?| = when () {
|
||||
R|<local>/b| -> {
|
||||
R|<local>/y|
|
||||
}
|
||||
else -> {
|
||||
Null(null)
|
||||
}
|
||||
}
|
||||
|
||||
<Inapplicable(INAPPLICABLE): [/takeInt]>#(R|<local>/x|)
|
||||
}
|
||||
Reference in New Issue
Block a user