Files
kotlin-fork/compiler/testData/codegen/box/javaInterop/generics/kt42825.kt
T
2021-10-02 06:14:35 +00:00

28 lines
585 B
Kotlin
Vendored

// IGNORE_BACKEND: WASM
// IGNORE_BACKEND: JS
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: NATIVE
// FILE: Processor.java
public interface Processor<T> {
boolean process(T t);
}
// FILE: test.kt
interface PsiModifierListOwner
interface KtClassOrObject {
fun toLightClass(): PsiModifierListOwner?
}
fun execute(declaration: Any, consumer: Processor<in PsiModifierListOwner>) {
when (declaration) {
is KtClassOrObject -> {
val lightClass = declaration.toLightClass()
consumer.process(lightClass)
}
}
}
fun box(): String = "OK"