ceylon / ceylon-spec

DEPRECATED
Apache License 2.0
108 stars 34 forks source link

no validation of use of native declaration in type expressions #1436

Closed gavinking closed 8 years ago

gavinking commented 8 years ago

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.

quintesse commented 8 years ago

Should be done, now. Closing.

gavinking commented 8 years ago

Thanks, I will try it out.

gavinking commented 8 years ago

Confirmed it's working. :)