Fixed error reporting for special constructions (if, elvis)

Track whether an error was reported for sub expressions (like 'if' branches) or it should be reported for the whole expression
 #KT-6189 Fixed
This commit is contained in:
Svetlana Isakova
2014-11-13 13:39:31 +03:00
parent 8109b1f997
commit 7f62675665
9 changed files with 201 additions and 31 deletions
@@ -0,0 +1,13 @@
// !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