Files
kotlin-fork/compiler/testData/codegen/box/fir/cannotCastToFunctionInIf.kt
T
2022-07-12 12:22:34 +00:00

20 lines
618 B
Kotlin
Vendored

// TARGET_BACKEND: JVM_IR
// See KT-53019
// See also cannotCastToFunction.kt with select instead of if
open class IrElement
fun IrElement.dumpKotlinLike(options: String = ""): String = "O"
fun IrElement.dump(normalizeNames: Boolean = false, stableOrder: Boolean = false): String = "K"
fun dump(data: IrElement, dumpStrategy: String): String {
val dump: IrElement.() -> String = if (dumpStrategy == "KotlinLike") IrElement::dumpKotlinLike else IrElement::dump
return data.dump()
}
fun box(): String {
val element = IrElement()
return dump(element, "KotlinLike") + dump(element, "OtherStrategy")
}