Edoardo Luppi
08/07/2023, 3:20 PMPromise<T>
I encountered https://youtrack.jetbrains.com/issue/KT-21846
Anyone else suppressing this compiler error? I do suppress and it works with the current compiler, but with K2 it just error out.anton.bannykh
08/07/2023, 3:26 PMEdoardo Luppi
08/07/2023, 3:28 PM// Common
public expect class ZDeferred<T>
// JS
@Suppress("ACTUAL_TYPE_ALIAS_TO_CLASS_WITH_DECLARATION_SITE_VARIANCE", "ACTUAL_WITHOUT_EXPECT")
public actual typealias ZDeferred<T> = Promise<T>
// JVM
public actual typealias ZDeferred<T> = CompletableFuture<T>
And usage:
// Common
@JsExport
@Suppress("NON_EXPORTABLE_TYPE")
public interface ZSocket {
...
public fun <T : ZSerializable> serialize(serializable: T): ZDeferred<T>
anton.bannykh
08/07/2023, 3:36 PMEdoardo Luppi
08/07/2023, 3:38 PMEdoardo Luppi
08/07/2023, 3:39 PMEdoardo Luppi
08/07/2023, 4:09 PM