// ISSUE: KT-60291 // WITH_STDLIB // IGNORE_LIGHT_ANALYSIS // IGNORE_BACKEND_K1: ANY // REASON: red code (see corresponding diagnostic test) fun box(): String { selectBuildee( build { setTypeVariable(TargetType()) }, build {} ) return "OK" } fun selectBuildee(vararg values: Buildee): Buildee = values.first() class TargetType class Buildee { fun setTypeVariable(value: TV) { storage = value } private var storage: TV = TargetType() as TV } fun build(instructions: Buildee.() -> Unit): Buildee { return Buildee().apply(instructions) }