Array attributes silently don't work #12

Open
moritz opened this Issue Jan 29, 2011 · 2 comments

Comments

Projects
None yet
3 participants
Owner

moritz commented Jan 29, 2011

class A {
    has @!x;
    method pushx($a) {
        pir::push(@!x, $a);
        say(pir::join('|', @!x));
    }
}

A.new.pushx('42');

# output: an empty line. Should be 42\n, IMHO

That's the same both in master and nom branch. Needs fixing :-)

Owner

jnthn commented Jan 29, 2011

Also needs fixing in nqpclr.

@ghost

ghost commented Feb 2, 2011

This will ultimately depend on whether the underlying object model automatically binds @!x of self to an array object of some sort when a new instance is created (or first accessed). NQP cannot really force it to happen as part of scope initialization, like it can for local variables.

Pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment