Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/PersistentStateComponent.kt
T
Nikolay Lunyak 88ff93df7f [FIR] Check is for impossibility
^KT-58203 Fixed
^KT-62646
2024-03-08 15:37:44 +00:00

28 lines
687 B
Kotlin
Vendored

// 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 (<!USELESS_IS_CHECK!>beforeRunTask is PersistentStateComponent<*><!>) {
deserializeAndLoadState(beforeRunTask)
}
}