// ISSUE: KT-53422 // IGNORE_LIGHT_ANALYSIS // IGNORE_BACKEND: ANY // REASON: red code (see corresponding diagnostic test) fun box(): String { buildFromValue( innerBuild { setInnerTypeVariable(TargetType()) }, { it.placeholderExtensionInvokeOnInnerBuildee() } ) return "OK" } class TargetType class InnerBuildee { fun setInnerTypeVariable(value: ITV) { storage = value } private var storage: ITV = TargetType() as ITV } fun InnerBuildee.placeholderExtensionInvokeOnInnerBuildee() {} class Buildee fun innerBuild(instructions: InnerBuildee.() -> Unit): InnerBuildee { return InnerBuildee().apply(instructions) } fun buildFromValue(value: PTV, instructions: Buildee.(PTV) -> Unit): Buildee { return Buildee().apply { instructions(value) } }