K1: don't report assignment TYPE_MISMATCH in BI under feature ON
Related to KT-54004
This commit is contained in:
committed by
Space Team
parent
6c6d653e85
commit
8e48636b29
Vendored
+21
@@ -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' })
|
||||
}
|
||||
Reference in New Issue
Block a user