Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG w/ tests] our values declaration #2498

Closed
p6rt opened this issue Oct 3, 2011 · 5 comments
Closed

[BUG w/ tests] our values declaration #2498

p6rt opened this issue Oct 3, 2011 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Oct 3, 2011

Migrated from rt.perl.org#100560 (status was 'resolved')

Searchable as RT100560$

@p6rt
Copy link
Author

p6rt commented Oct 3, 2011

From slunski@gmail.com

Hallo,

I have problem with our declaration with initialization on nom branch, Star
2011.07
(Debian package) works OK.

Error message is​:

Method 'STORE' not found for invocant of class 'Any'␤ in <anon> at

What makes problems​:

our %h = { 'a' => 1, 'b' => 2 }
our @​h = < 'a', 'b'>
our @​h; @​h = < 'a', 'b'>

class A { our %h = { 'a' => 1, 'b' => 2 } }
class A { our @​h = < 'a', 'b'> }

This work OK​:

our %a
our @​a
our $a
our $a = 1

so our-scalar + initialization works OK.

Probably there is another bug (in Star and nom)​:

class A { has %!h = { 'a' => 1, 'b' => 2 } ; my @​a = %!h.keys }

gives​:
b​: Null PMC access in get_attr_str()
nom​: Can only use repr_get_attr_obj on a SixModelObject

Inside BEGIN same errors​:

class A { BEGIN {has %!h = { 'a' => 1, 'b' => 2 } ; my @​a = %!h.keys} }

But this works​:

class A { has %!h = { 'a' => 1, 'b' => 2 } ; method aa {my @​a = %!h.keys} }

And 'my' version works too​:

class A { my %h = { 'a' => 1, 'b' => 2 } ; my @​a = %h.keys }

So problem is that code in class but outside methods do not work. Maybe it
should not ?
Initilaization alone work OK​:

class A { has %!h = { 'a' => 1, 'b' => 2 } }
class A { BEGIN {has %!h = { 'a' => 1, 'b' => 2 } }

Best regards,

Sylwester Lunski

--
Sylwester Łuński, slunski@​gmail.com

@p6rt
Copy link
Author

p6rt commented May 9, 2013

From @FROGGS

Added tests​: Raku/roast@8c3db86165

@p6rt
Copy link
Author

p6rt commented May 9, 2013

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented May 9, 2013

From @FROGGS

Fixed​:
rakudo/rakudo@bfd8508

@p6rt
Copy link
Author

p6rt commented May 9, 2013

@FROGGS - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed May 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant