eclipse-archived / ceylon

The Ceylon compiler, language module, and command line tools
http://ceylon-lang.org
Apache License 2.0
395 stars 62 forks source link

Runtime type of simple function wrong in JS backend #7392

Open dlkw opened 5 years ago

dlkw commented 5 years ago

When run on the JS backend, the following toplevel function fails with

Error: Assertion failed: 
    violated is Callable<Anything, []> when

On the JVM, it passes. (Using Ceylon 1.3.3.)

shared void run()
{
    void rrr<Where=[]>(Callable<Anything, Where> when)
    {
        assert (is Callable<Anything, []> when);
    }
    print(1);
    rrr(()=>1/0); // passes assertion on JVM and JS
    print(2);
    rrr{when()=>1/0;}; // fails assertion on JS (passes on JVM)
    print(3);
}

(Detected while using specks, see https://github.com/renatoathaydes/specks/issues/15.)