ceylon/ceylon-js

Default implementation of toplevel function gives error

quintesse opened this issue · 2 comments

The following code:

native void nf1() {
    print("nf1");
}

shared void run() {
    nf1();
}

results in "ReferenceError: nf1 is not defined" on JS. On the JVM, it compiles and outputs "nf1", it should do the same for JS.

native headers cannot provide their own default impls? So this should be an error? Why then does the JVM backend compile it just fine?

@chochos sorry, I copied that from the original that was opened on ceylon-spec. The given code example should indeed work, just like on the JVM. I'll edit the text.