report type mismatch deeply on branches for if
in type argument inference case
This commit is contained in:
+27
@@ -0,0 +1,27 @@
|
||||
package b
|
||||
|
||||
fun bar(i: Int) = i
|
||||
|
||||
fun test(a: Int?, b: Int?) {
|
||||
bar(if (a == null) return else <!TYPE_MISMATCH!>b<!>)
|
||||
}
|
||||
|
||||
fun test(a: Int?, b: Int?, c: Int?) {
|
||||
bar(if (a == null) return else if (b == null) return else <!TYPE_MISMATCH!>c<!>)
|
||||
}
|
||||
|
||||
fun test(a: Any?, b: Any?, c: Int?) {
|
||||
bar(if (a == null) if (b == null) <!TYPE_MISMATCH!>c<!> else return else return)
|
||||
}
|
||||
|
||||
fun test(a: Int?, b: Any?, c: Int?) {
|
||||
bar(if (a == null) {
|
||||
return
|
||||
} else {
|
||||
if (b == null) {
|
||||
return
|
||||
} else {
|
||||
<!TYPE_MISMATCH!>c<!>
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user