ceylon / ceylon-spec

DEPRECATED
Apache License 2.0
108 stars 34 forks source link

no error for missing native impls of toplevel function #1445

Closed jvasileff closed 8 years ago

jvasileff commented 8 years ago

For classes, native headers cannot provide their own default implementations. So I presume the same should be true for functions.

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

//native("js") void nf1() {}
//native("jvm") void nf1() {}

shared void run() {
    nf1();
}

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

Should a body even be allowed for native function headers?

quintesse commented 8 years ago

If it works on the JVM then why do you open it for ceylon-spec? This is supported behaviour and the bug is in the JS backend.

quintesse commented 8 years ago

Copied to ceylon/ceylon-js/issues/655

jvasileff commented 8 years ago

why do you open it for ceylon-spec

The answer is in the issue description.