[NI] Fix completion for ILT when Nothing constraint is present
Full completion should not be done if lower `Nothing` is the only proper constraint when constraint with ILT type is present. ILT will be selected as a resulting type and transformed into `Int` without attention to possible restrictions from outer calls.
This commit is contained in:
+44
@@ -0,0 +1,44 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
|
||||
fun test(boolean: Boolean) {
|
||||
val expectedLong: Long = if (boolean) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Long")!>if (boolean) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Long")!>42<!>
|
||||
} else {
|
||||
return
|
||||
}<!>
|
||||
} else {
|
||||
return
|
||||
}
|
||||
|
||||
val expectedInt: Int = if (boolean) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>if (boolean) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>42<!>
|
||||
} else {
|
||||
return
|
||||
}<!>
|
||||
} else {
|
||||
return
|
||||
}
|
||||
|
||||
val expectedShort: Short = if (boolean) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Short")!>if (boolean) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Short")!>42<!>
|
||||
} else {
|
||||
return
|
||||
}<!>
|
||||
} else {
|
||||
return
|
||||
}
|
||||
|
||||
val expectedByte: Byte = if (boolean) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Byte")!>if (boolean) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Byte")!>42<!>
|
||||
} else {
|
||||
return
|
||||
}<!>
|
||||
} else {
|
||||
return
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user