[FIR] Implement ASSIGNMENT_TYPE_MISMATCH, RESULT_TYPE_MISMATCH diagnostics, fix tests
This commit is contained in:
committed by
TeamCityServer
parent
aa70c952eb
commit
e57108d4e8
Vendored
+2
-2
@@ -5,6 +5,6 @@ interface Tr<T> {
|
||||
}
|
||||
|
||||
fun test(t: Tr<*>) {
|
||||
t.v = t
|
||||
t.v = <!ASSIGNMENT_TYPE_MISMATCH!>t<!>
|
||||
t.v checkType { _<Tr<*>>() }
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@ interface Tr<T> {
|
||||
|
||||
fun test(t: Tr<*>) {
|
||||
t.v = null!!
|
||||
t.v = ""
|
||||
t.v = <!ASSIGNMENT_TYPE_MISMATCH!>""<!>
|
||||
t.v = <!NULL_FOR_NONNULL_TYPE!>null<!>
|
||||
t.v checkType { _<Any?>() }
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -7,5 +7,5 @@ interface Tr<T> {
|
||||
fun test(t: Tr<out String>) {
|
||||
// resolved as t.v = t.v + null!!, where type of right operand is String,
|
||||
// so TYPE_MISMATCH: String is not <: of Captured(out String)
|
||||
t.v += null!!
|
||||
}
|
||||
<!ASSIGNMENT_TYPE_MISMATCH!>t.v += null!!<!>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user