andylamax
12/24/2023, 12:53 AMexpect interface Promise<out T>
• src/jvmMain/Promise.kt
@file:Suppress(
"ACTUAL_WITHOUT_EXPECT",
"ACTUAL_TYPE_ALIAS_TO_CLASS_WITH_DECLARATION_SITE_VARIANCE"
)
actual typealias Promise<T> = java.util.concurrent.CompletionStage<T>
Results are as follows
a) Without any suppresses, the compilation fails with
• 'actual typealias Promise<T> = CompletionStage<T>' has no corresponding expected declaration
• The following declaration is incompatible because declaration-site variances of type parameters are different
On both kotlin K1 (1.9.21) and K2 (2.0.0-Beta1,2.0.0-Beta2)
b) With @Suppress("ACTUAL_WITHOUT_EXPECT")
The program compiles file on K1 (1.9.21)
but fails on K2 (2.0.0-Beta1,2.0.0-Beta2)
• Expect declaration Promise is incompatible with actual Promise because declaration-site variances of type parameters are different
c) With @Suppress("ACTUAL_WITHOUT_EXPECT","ACTUAL_TYPE_ALIAS_TO_CLASS_WITH_DECLARATION_SITE_VARIANCE")
Results are similar to (b), its like the former suppress directive has no effect at all
Now I know the kotlin team doesn't really investigate code with suppresses, but how should we approach this currently?? I can't seem to be able to provide an actual type alias for this.
Also, is there a current issue for this?? Or should I file a ticket??dmitriy.novozhilov
12/24/2023, 10:07 AMEdoardo Luppi
12/28/2023, 9:50 AM