[FIR] Implement ASSIGNMENT_TYPE_MISMATCH, RESULT_TYPE_MISMATCH diagnostics, fix tests

This commit is contained in:
Ivan Kochurkin
2021-04-19 12:12:49 +03:00
committed by TeamCityServer
parent aa70c952eb
commit e57108d4e8
40 changed files with 200 additions and 131 deletions
@@ -107,7 +107,7 @@ fun foo() {
if (bool) <!ASSIGNED_VALUE_IS_NEVER_READ!>a<!> = 4 else <!ASSIGNED_VALUE_IS_NEVER_READ!>a<!> = 42
val <!VARIABLE_NEVER_READ!>b<!>: String
<!ASSIGNED_VALUE_IS_NEVER_READ!>b<!> = false
<!ASSIGNED_VALUE_IS_NEVER_READ!>b<!> = <!ASSIGNMENT_TYPE_MISMATCH!>false<!>
}
fun cycles() {
@@ -5,5 +5,5 @@ fun foo() {
// now, Idea hightlights this code like error (cuz listVar
// is mutable and listVar + 4 is immutable) and like warning
// (cuz can be replaced with +=)
<!ASSIGNED_VALUE_IS_NEVER_READ!>listVar<!> = listVar + 4
<!ASSIGNED_VALUE_IS_NEVER_READ!>listVar<!> = <!ASSIGNMENT_TYPE_MISMATCH!>listVar + 4<!>
}
@@ -7,7 +7,7 @@ class B(p0: String) {
p3 = p1
}
init {
p1 = p0.length
p1 = <!ASSIGNMENT_TYPE_MISMATCH!>p0.length<!>
p3 = ""
}
}