7f62675665
Track whether an error was reported for sub expressions (like 'if' branches) or it should be reported for the whole expression #KT-6189 Fixed
13 lines
300 B
Kotlin
Vendored
13 lines
300 B
Kotlin
Vendored
// !DIAGNOSTICS: -USELESS_ELVIS
|
|
|
|
fun test() {
|
|
bar(if (true) {
|
|
<!CONSTANT_EXPECTED_TYPE_MISMATCH!>1<!>
|
|
} else {
|
|
<!CONSTANT_EXPECTED_TYPE_MISMATCH!>2<!>
|
|
})
|
|
|
|
bar(<!CONSTANT_EXPECTED_TYPE_MISMATCH!>1<!> ?: <!CONSTANT_EXPECTED_TYPE_MISMATCH!>2<!>)
|
|
}
|
|
|
|
fun bar(s: String) = s |