// LATEST_LV_DIFFERENCE
// RUN_PIPELINE_TILL: FRONTEND
// ISSUE: KT-68834
class Foo {
    var alias: Foo = this

    operator fun get(index: Int): Foo { return this }
    operator fun set(index: Int, arg: Foo) {  }
    operator fun plusAssign(arg: String) {  }
    operator fun inc(): Foo { return this }
    operator fun invoke(arg: String) {  }
}

operator fun Foo?.get(index: Int): Foo? { return this }
operator fun Foo?.set(index: Int, arg: Foo?) {}
operator fun Foo?.plusAssign(arg: String) {}
operator fun Foo?.inc(): Foo { return this!! }
operator fun Foo?.invoke(arg: String) { }

fun huh(arg: Foo?) {
    arg?.alias[42] 
    arg?.alias[42] = arg
    arg?.alias += "" 
    arg?.alias++ 
    ++arg?.alias 
    arg?.alias("") 
    arg?.alias[42] += ""
    arg?.alias[42]++
    ++arg?.alias[42]

    (arg?.alias)[42] 
    (arg?.alias)[42] = arg
    (arg?.alias) += "" 
    <!WRAPPED_LHS_IN_ASSIGNMENT_ERROR!>(arg?.<!VARIABLE_EXPECTED!>alias<!>)<!>++
    ++<!WRAPPED_LHS_IN_ASSIGNMENT_ERROR!>(arg?.<!VARIABLE_EXPECTED!>alias<!>)<!>
    (arg?.alias)("") 
    (arg?.alias)[42] += ""
    (arg?.alias[42]) += ""
    <!WRAPPED_LHS_IN_ASSIGNMENT_ERROR!>(arg?.alias[42])<!>++
    ++<!WRAPPED_LHS_IN_ASSIGNMENT_ERROR!>(arg?.alias[42])<!>
}

/* GENERATED_FIR_TAGS: assignment, checkNotNullCall, classDeclaration, funWithExtensionReceiver, functionDeclaration,
incrementDecrementExpression, integerLiteral, nullableType, operator, propertyDeclaration, safeCall, smartcast,
stringLiteral, thisExpression */
