// ISSUE: KT-53740 // IGNORE_LIGHT_ANALYSIS // IGNORE_BACKEND: ANY // REASON: red code (see corresponding diagnostic test) fun box(): String { parallelBuild( { setTypeVariable(TargetType()) }, { consumeDifferentType(getTypeVariable()) } ) return "OK" } class TargetType class DifferentType fun consumeDifferentType(value: DifferentType) {} class Buildee { fun setTypeVariable(value: TV) { storage = value } fun getTypeVariable(): TV = storage private var storage: TV = TargetType() as TV } fun parallelBuild( instructionsA: Buildee.(PTV) -> Unit, instructionsB: Buildee.(PTV) -> Unit ): Buildee { val value = TargetType() as PTV return Buildee().apply { instructionsA(value) instructionsB(value) } }