// ISSUE: KT-61310 // IGNORE_LIGHT_ANALYSIS // REASON: red code (see corresponding diagnostic test) fun box(): String { build { if (true) { setTypeVariable(GenericBox()) } else { setTypeVariable(GenericBox()) } } return "OK" } class TargetType class GenericBox class Buildee { fun setTypeVariable(value: TV) { storage = value } private var storage: TV = GenericBox() as TV } fun build(instructions: Buildee.() -> Unit): Buildee { return Buildee().apply(instructions) }