ceylon / ceylon-js

DEPRECATED
Apache License 2.0
54 stars 9 forks source link

NPE for misplaced `let` #492

Closed sgalles closed 9 years ago

sgalles commented 9 years ago

This code isn't correct, but causes an NPE when compiled :

shared void run() {
    class Foo(){
        value m =  {1 -> "2", 3 -> let(a = "5") "4"};
    }
    Foo(); 
} 
java.lang.NullPointerException
        at com.redhat.ceylon.compiler.js.JsIdentifierNames.getName(JsIdentifierNames.java:257)
        at com.redhat.ceylon.compiler.js.JsIdentifierNames.getter(JsIdentifierNames.java:151)
        at com.redhat.ceylon.compiler.js.JsOutput.publishUnsharedDeclarations(JsOutput.java:168)
        at com.redhat.ceylon.compiler.js.JsCompiler.finish(JsCompiler.java:422)
        at com.redhat.ceylon.compiler.js.JsCompiler.generate(JsCompiler.java:364)