ceylon/ceylon-spec

no validation of use of native declaration in type expressions

gavinking opened this issue · 3 comments

In a cross-platform module, the typechecker rightly rejects the following code:

import java.lang {
    Integer
}

shared void run() {
    Integer("");
}

But it accepts this code:

import java.lang {
    Integer
}

shared void run() {
    Integer i;
}

It even accepts the following code:

import java.io {
    InputStream
}

class Run() extends InputStream() {
    shared actual Integer read() => nothing;
}

Which of course blows up the JS backend.

@quintesse this is for you, of course.

Should be done, now. Closing.

Thanks, I will try it out.

Confirmed it's working. :)