winxed icon indicating copy to clipboard operation
winxed copied to clipboard

return with clazz.new() fail

Open Eclesia opened this issue 14 years ago • 3 comments

Error can be reproduce like this :

class Foo { function initvtable { say("Foo init"); } function hello() { say(FUNCTION); } }

function newInstance(var clazz){ return clazz.new(); }

function main(){ var clazz = class Foo; var f = newInstance(clazz); f.hello(); }

Eclesia avatar Aug 27 '11 19:08 Eclesia

I think this is a parrot fault, but I'm not sure where it lies.

NotFound avatar Sep 08 '11 20:09 NotFound

I've opened a parrot ticket, TT #2193

NotFound avatar Sep 19 '11 22:09 NotFound

Ticket can now be found at parrot/parrot#596

And here's the original code with indenting:

class Foo {
    function init[vtable] {
        say("Foo init");
    }
    function hello() {
        say(FUNCTION);
    }
}

function newInstance(var clazz) {
    return clazz.new();
}

function main() {
    var clazz = class Foo;
    var f = newInstance(clazz);
    f.hello();
}

Benabik avatar Apr 24 '12 14:04 Benabik