# New Ticket Created by  Richard Hainsworth 
# Please include the string:  [perl #120904]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=120904 >


'is default' trait works in mainline, but not in classes

if 'is default' is the default for classes, then behaviour is not the 
same as in mainline

So either
a) is default not implemented for classes;
b) spec for classes does not have the same behaviour as is default for 
mainline.

$ perl6 -v
This is perl6 version 2013.11 built on parrot 5.9.0 revision 0
$ perl6
 > class A { has $.a is default(2) is rw}
Null PMC access in get_string()
 >
 > my $a is default(2); $a=3; say $a;
3
 > $a=Nil; say $a
2
 > class B { has $.a is rw = 2}; my B $x.=new; say $x
B.new(a => 2)
 > $x.a=Nil; say $x
B.new(a => Any)



Richard Hainsworth
finanalyst



Reply via email to