FE: add reproducer for KT-54004

This commit is contained in:
Mikhail Glukhikh
2022-10-07 12:21:01 +02:00
committed by Space Team
parent 80c0c33670
commit 0940707fd4
7 changed files with 77 additions and 0 deletions
@@ -0,0 +1,20 @@
class Foo<T : Any> {
fun doSmthng(arg: T) {}
var a: T? = null
}
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"<!>
}
val x = 57
val value = myBuilder {
doSmthng("one ")
a = <!ASSIGNMENT_TYPE_MISMATCH!>57<!>
a = <!ASSIGNMENT_TYPE_MISMATCH!>x<!>
}
println(value.a?.count { it in 'l' .. 'q' })
}