winxed
winxed copied to clipboard
return with clazz.new() fail
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(); }
I think this is a parrot fault, but I'm not sure where it lies.
I've opened a parrot ticket, TT #2193
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();
}