develooper Front page | perl.perl6.compiler | Postings from July 2010

[perl #76450] 'our' variables in roles can't be accessed from the outside

From:
Moritz Lenz
Date:
July 10, 2010 16:08
Subject:
[perl #76450] 'our' variables in roles can't be accessed from the outside
Message ID:
rt-3.6.HEAD-11314-1278778683-442.76450-82-0@perl.org
# New Ticket Created by  Moritz Lenz 
# Please include the string:  [perl #76450]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=76450 >


Fails with roles:

18:16 <@moritz_> rakudo: role Foo { our $pi = 3 }; say $Foo::pi
18:16 <+p6eval> rakudo 692aa1: OUTPUT«Null PMC access in type()␤  in
main program body at line 20:/tmp/M57BNs8HR2␤»

Works with modules:

18:16 <@moritz_> rakudo: module Foo { our $pi = 3 }; say $Foo::pi
18:16 <+p6eval> rakudo 692aa1: OUTPUT«3␤»



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