// RUN_PIPELINE_TILL: BACKEND
// DIAGNOSTICS: -UNUSED_PARAMETER
// WITH_STDLIB

class Foo<T> {
    private fun append(map: MutableMap<String, T>, field: String, appendedValue: T?) {
        if (appendedValue != null) {
            var currentValue: T? = map[field]
            currentValue = if (currentValue == null) {
                appendedValue
            } else {
                or(<!DEBUG_INFO_SMARTCAST!>currentValue<!>, <!DEBUG_INFO_SMARTCAST!>appendedValue<!>)
            }
            map[field] = <!DEBUG_INFO_SMARTCAST!>currentValue<!>
        }
    }

    fun or(left: T, right: T): T = left
}

/* GENERATED_FIR_TAGS: assignment, classDeclaration, dnnType, equalityExpression, functionDeclaration, ifExpression,
localProperty, nullableType, propertyDeclaration, smartcast, typeParameter */
