develooper Front page | perl.perl6.compiler | Postings from August 2012

[perl #72326] [BUG] The same class-wide variable, accessed two different ways, behaves like two different variables in Rakudo

From:
Carl Mäsak via RT
Date:
August 5, 2012 14:30
Subject:
[perl #72326] [BUG] The same class-wide variable, accessed two different ways, behaves like two different variables in Rakudo
Message ID:
rt-3.6.HEAD-11172-1344202235-787.72326-15-0@perl.org
<masak> r: class A::B { my $c = 42; method foo { $A::B::c = "OH HAI"; say 
$c } }; A::B.foo
<p6eval> rakudo 0eea68: OUTPUT«42␤»
<masak> r: class A::B { my $c = 42; method foo { $c = "OH HAI"; say 
$A::B::c } }; A::B.foo
<p6eval> rakudo 0eea68: OUTPUT«Any()␤»
<masak> the former one is fine, I guess. at least if package stashes can 
be extended like that.
<masak> the latter one is, hm, also fine.
* masak rejects https://rt.perl.org/rt3/Ticket/Display.html?id=72326

The original ticket seems to stem from a confusion between my-scoped and 
our-scoped variables, and the containers they share. I see nothing 
unexpected in the above. Rejecting ticket.



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About