Closed marchuk0 closed 9 hours ago
It's not really a bug, but a missing feature. Generics in Kotlin are mostly compile time feature and are naturally erased at runtime. Functional types are also generics. Any functional type is treated as (...) -> Any?
. This is why autoUnit
does not work properly with generics (functions included).
With compiler plugin capabilities it should possible to preserve information about type arguments and improve the way autoUnit
works. I will investigate it. Thank you for reporting the issue!
AutoUnit does not work for functional types.
The first test from the example below will fail, while the second one is successful.
Kotlin multiplatform version: 1.9.24 Kotlin multiplatform target: js Mokkery version: 1.9.24-1.7.0