// !LANGUAGE: +NoBuilderInferenceWithoutAnnotationRestriction // FIR_DUMP class Foo { fun doSmthng(arg: T) {} var a: T? = null } fun myBuilder(block: Foo.() -> Unit) : Foo = Foo().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' }) }