// ISSUE: KT-57707 // IGNORE_LIGHT_ANALYSIS // IGNORE_BACKEND_K1: ANY // REASON: red code (see corresponding diagnostic test) fun box(): String { build { setTypeVariable(TargetType()) extensionSetOutProjectedTypeVariable(DifferentType()) } return "OK" } class TargetType class DifferentType class Buildee { fun setTypeVariable(value: TV) { storage = value } private var storage: TV = TargetType() as TV } fun Buildee.extensionSetOutProjectedTypeVariable(value: ETV) { this as Buildee setTypeVariable(value) } fun build(instructions: Buildee.() -> Unit): Buildee { return Buildee().apply(instructions) }