K1: don't report assignment TYPE_MISMATCH in BI under feature ON

Related to KT-54004
This commit is contained in:
Mikhail Glukhikh
2022-10-22 11:58:47 +02:00
committed by Space Team
parent 6c6d653e85
commit 8e48636b29
12 changed files with 255 additions and 0 deletions
@@ -0,0 +1,21 @@
// !LANGUAGE: +NoBuilderInferenceWithoutAnnotationRestriction
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(arg: Any) {
val x = 57
val value = myBuilder {
doSmthng("one ")
a = 57
a = x
if (arg is String) {
a = arg
}
}
println(value.a?.count { it in 'l' .. 'q' })
}