Skip to content

Support compiling common KMP code #377

Closed
@baconz

Description

@baconz

I would like to be able to compile code as common module sources so that I can test compilation of @JsExport annotated classes. I tried messing with the paths of the modules, but could not find a way to convince the compiler that my code is in the common module.

As an example, you can try compiling something simple like:

@JsExport
fun add(a: Double, b: Double): Double {
  return a + b
}

You will get a compiler error along the lines of:

Declaration annotated with '@OptionalExpectation' can only be used in common module sources

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions