K1: report TYPE_MISMATCH for incorrect assignments in builder
#KT-54004 Fixed
This commit is contained in:
committed by
Space Team
parent
0940707fd4
commit
0080f16cc2
+4
-5
@@ -5,16 +5,15 @@ class Foo<T : Any> {
|
||||
|
||||
fun <T : Any> myBuilder(block: Foo<T>.() -> Unit) : Foo<T> = Foo<T>().apply(block)
|
||||
|
||||
fun main() {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>myBuilder<!> {
|
||||
a = <!ASSIGNMENT_TYPE_MISMATCH!>"some string"<!>
|
||||
}
|
||||
|
||||
fun main(arg: Any) {
|
||||
val x = 57
|
||||
val value = myBuilder {
|
||||
doSmthng("one ")
|
||||
a = <!ASSIGNMENT_TYPE_MISMATCH!>57<!>
|
||||
a = <!ASSIGNMENT_TYPE_MISMATCH!>x<!>
|
||||
if (arg is String) {
|
||||
a = arg
|
||||
}
|
||||
}
|
||||
println(value.a?.count { it in 'l' .. 'q' })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user