[NI] Remove hack for special functions
Treating special functions for `if`, `when`, `try`, `?:` as not accepting `Nothing` result type is incorrect. Making so leads to cases with uninferred `Nothing` result type for inner calls and lost data flow info.
This commit is contained in:
@@ -58,10 +58,10 @@ fun case_3() {
|
||||
*/
|
||||
fun case_4() {
|
||||
var x: Int? = null
|
||||
if (x == try { x = 10; null } finally {} && x != null) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Int?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Int?"), DEBUG_INFO_SMARTCAST!>x<!>.inv()
|
||||
println(1)
|
||||
if (x == try { x = 10; null } finally {} && <!SENSELESS_COMPARISON!><!DEBUG_INFO_CONSTANT!>x<!> != null<!>) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Int? & kotlin.Nothing")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing"), DEBUG_INFO_SMARTCAST!>x<!>.<!UNREACHABLE_CODE!>inv()<!>
|
||||
<!UNREACHABLE_CODE!>println(1)<!>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user