FIR: fix capturing on intersection types #KT-48109 Fixed

This commit is contained in:
Mikhail Glukhikh
2021-08-05 14:05:24 +03:00
parent a04913a197
commit a21d281c19
9 changed files with 99 additions and 26 deletions
@@ -0,0 +1,27 @@
// FILE: ComponentSerializationUtil.java
import org.jetbrains.annotations.NotNull;
public final class ComponentSerializationUtil {
@NotNull
public static <S> Class<S> getStateClass(@NotNull Class<? extends PersistentStateComponent> aClass)
{}
}
// FILE: use.kt
class BeforeRunTask<T>
interface PersistentStateComponent<T>
fun <T> deserializeAndLoadState(
component: PersistentStateComponent<T>,
clazz: Class<T> = ComponentSerializationUtil.getStateClass(component::class.java)
) {}
fun use(beforeRunTask: BeforeRunTask<*>) {
if (beforeRunTask is PersistentStateComponent<*>) {
deserializeAndLoadState(beforeRunTask)
}
}