Humanize type mismatch diagnostic caused by type projections
#KT-10581 Fixed
This commit is contained in:
+1
-1
@@ -4,6 +4,6 @@ interface Tr<T> {
|
||||
}
|
||||
|
||||
fun test(t: Tr<*>) {
|
||||
t.v = <!TYPE_MISMATCH!>t<!>
|
||||
<!SETTER_PROJECTED_OUT!>t.v<!> = t
|
||||
t.v checkType { _<Tr<*>>() }
|
||||
}
|
||||
+2
-2
@@ -7,7 +7,7 @@ interface Tr<T> {
|
||||
|
||||
fun test(t: Tr<*>) {
|
||||
t.v = null!!
|
||||
t.v = <!TYPE_MISMATCH!>""<!>
|
||||
t.v = <!NULL_FOR_NONNULL_TYPE!>null<!>
|
||||
<!SETTER_PROJECTED_OUT!>t.v<!> = ""
|
||||
<!SETTER_PROJECTED_OUT!>t.v<!> = null
|
||||
t.v checkType { _<Any?>() }
|
||||
}
|
||||
Vendored
+1
-1
@@ -6,5 +6,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)
|
||||
<!TYPE_MISMATCH!>t.v += null!!<!>
|
||||
<!SETTER_PROJECTED_OUT!>t.v<!> += null!!
|
||||
}
|
||||
Reference in New Issue
Block a user