blob: 0e86f57e9688313e3aa48fcc434da34601f900fa [file]
// LANGUAGE: +NameBasedDestructuring +DeprecateNameMismatchInShortDestructuringWithParentheses +EnableNameBasedDestructuringShortForm
// RUN_PIPELINE_TILL: FRONTEND
// CHECK_TYPE
operator fun Int.component1() = "a"
fun foo(a: Number) {
val [x] = a as Int
checkSubtype<Int>(a)
checkSubtype<String>(x)
}
/* GENERATED_FIR_TAGS: asExpression, classDeclaration, destructuringDeclaration, funWithExtensionReceiver,
functionDeclaration, functionalType, infix, localProperty, nullableType, operator, propertyDeclaration, smartcast,
stringLiteral, typeParameter, typeWithExtension */