Files
kotlin-fork/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/IfThenElseBothInvalid.kt
T
Svetlana Isakova c739632c57 report 'ambiguity' on reference, not on the whole expression
as other type inference errors
2013-09-03 13:09:15 +04:00

17 lines
358 B
Kotlin

fun bar(x: Int): Int = x + 1
fun foo() {
val x: Int? = null
bar(<!TYPE_MISMATCH!>x<!>)
if (x != 2) {
if (x == null) return
2<!OVERLOAD_RESOLUTION_AMBIGUITY!>+<!><!SYNTAX!><!>
}
else {
if (<!SENSELESS_COMPARISON!>x == null<!>) return
2<!OVERLOAD_RESOLUTION_AMBIGUITY!>+<!><!SYNTAX!><!>
}
bar(x)
}