// RUN_PIPELINE_TILL: BACKEND
// FIR_IDENTICAL

interface Units<UValue : Any>

class SimpleDoubleUnits : Units<Double>

fun <BLeft : Any> build(builderCode: RendererBuilder<BLeft>.() -> Unit) {}

class RendererBuilder<RBLeft : Any> {
    var leftScaleCurves: CurveSet<RBLeft>? = null

    fun addDecorations(render: suspend RenderContext<RBLeft>.() -> Unit) {}
}

interface RenderContext<RCLeft : Any> {
    val leftScaleValueToY: ((RCLeft) -> Double)?
}

class State {
    suspend fun render() {
        build {
            leftScaleCurves = CurveSet(SimpleDoubleUnits())
            addDecorations {
                leftScaleValueToY!!(0.67)
            }
        }
    }
}

class CurveSet<CY : Any>(units: Units<CY>)

/* GENERATED_FIR_TAGS: assignment, checkNotNullCall, classDeclaration, functionDeclaration, functionalType,
interfaceDeclaration, lambdaLiteral, nullableType, primaryConstructor, propertyDeclaration, suspend, typeConstraint,
typeParameter, typeWithExtension */
