Edoardo Luppi
02/14/2024, 7:10 PMtsFunction(value: string | number)
Could be translated to
fun tsFunction(value: Union<String, Int>)
And when being called
tsFunction("example")
The plugin could erase the Union type and perform type checking.
I'm dreaming too much?turansky
02/14/2024, 8:03 PMEdoardo Luppi
02/14/2024, 8:06 PMArray<string | number>
This can't be nicely expressed unfortunately, as far as I understand Array<Any>
is the only solution in Kotlinturansky
02/14/2024, 8:07 PMArray<Comparable>
Edoardo Luppi
02/14/2024, 8:08 PMturansky
02/14/2024, 8:09 PMEdoardo Luppi
02/14/2024, 8:10 PMEdoardo Luppi
02/14/2024, 8:13 PMtypealias Union<First, Second> = Any
But still no type checking for parameters.Edoardo Luppi
02/14/2024, 8:14 PMturansky
02/14/2024, 8:17 PMturansky
02/14/2024, 8:18 PMturansky
02/14/2024, 8:19 PMEdoardo Luppi
02/14/2024, 8:34 PMThenable<void> | void
The first one is much clearer when attempting to use it.turansky
02/14/2024, 10:41 PMThenable<void> | void
-> PromiseResult<Void>