Why does the `@JvmOverloads` annotation not no-op ...
# multiplatform
o
Why does the
@JvmOverloads
annotation not no-op for wasmJs compilations, but does so for native? I have a multiplatform project that currently targets native code only. In my common folder, I have an expect class defined as follows:
Copy code
public expect class ArraySet<E> @JvmOverloads constructor(capacity: Int = 0)
This class uses the @JvmOverloads annotation. In the actual class implementation for the native target, I also use the @JvmOverloads annotation:
Copy code
public actual class ArraySet<E> @kotlin.jvm.JvmOverloads actual constructor(capacity: Int)
This compiles without any errors. Now, I want to add support for wasmJs. However, when I declare the actual class for wasmJs in a similar manner and compile the code, I encounter the following error:
Copy code
Declaration annotated with '@OptionalExpectation' can only be used in common module sources
As a result of adding the JvmOverload annotation. Is this WAI?
a
probably a question for JetBrains but also @jw because i feel like he'd know