Hello; I recently upgraded to M3 from M1, for a mu...
# javascript
i
Hello; I recently upgraded to M3 from M1, for a multiplatform project where I am trying to write a Kotlin library that I will be able to consume on multiple platforms. I am seeing a lot of new restrictions applied to the js export. Some are understandable (e.g. no jsname on a secondary constructor), but others are not as clear:
Copy code
Declaration of such kind (enum class) cant be exported to JS
Why are enum classes no longer supported (e.g.
enum class Color { Red, Green, Blue }
)? Previously, a class was generated, and only the typescript would be lacking (maps to ‘any’). Now, it does not compile…
a
cc @Svyatoslav Kuzmich [JB]
s
Hello! Compiler errors related to JS export were not implemented in M1. As you noted, some of the newly introduced errors are reasonable and will continue to be errors in the future. Other errors indicate that feature is not complete, either in design or implementation department. Restriction of enum class export is one of these errors.
i
Thanks for the quick reply. Will enums come in 1.4, or later? Would this be more appropriately marked as experimental rather than an error?
2
s
Enums will not be in 1.4.0, but hopefully soon after it. I believe enum export is currently broken, so it is not up to our standard of “experimental” yet 🙂
d
@bbil