Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Array attributes silently don't work #12

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

Array attributes silently don't work #12

moritz opened this issue Jan 29, 2011 · 2 comments

Comments

@moritz
Copy link
Member

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 :-)

@jnthn
Copy link
Member

jnthn commented Jan 29, 2011

Also needs fixing in nqpclr.

@rakudo
Copy link

rakudo 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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants