ceylon / ceylon-js

DEPRECATED
Apache License 2.0
54 stars 9 forks source link

type parameter not captured in inner class #654

Closed jvasileff closed 9 years ago

jvasileff commented 9 years ago

This:

class NC5<T>() {
    shared void foo() {
        class C() {
            shared void bar() => print(`T`);
        }
        C().bar();
    }
}

shared void run() {
    NC5<String>().foo();
}

fails at runtime with:

$ ceylon compile-js && ceylon run-js simple
Note: Created module simple/1.0.0

/private/tmp/simple/modules/simple/1.0.0/simple-1.0.0.js:34
){return m$1.print(m$1.typeLiteral$meta({Type$typeLiteral:$2$.outer$.$$targs$$
                                                                    ^
TypeError: Cannot read property '$$targs$$' of undefined
    at $init$$2.$2$.bar (/private/tmp/simple/modules/simple/1.0.0/simple-1.0.0.js:34:86)
    at $init$NC5.nC5$.foo (/private/tmp/simple/modules/simple/1.0.0/simple-1.0.0.js:41:6)
    at run (/private/tmp/simple/modules/simple/1.0.0/simple-1.0.0.js:50:31)
    at [eval]:1:282
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:456:26)
    at evalScript (node.js:536:25)
    at startup (node.js:80:7)
    at node.js:906:3
ceylon run-js: Node process exited with non-zero exit code: 8
jvasileff@orion:simple$ 
chochos commented 9 years ago

this is actually a missing reference to this