All of the above parses now (on Moar, Parrot and JVM):

$ perl6 -e 'class A { has ($.x where 1) }; say "alive"'
alive

$ perl6 -e 'class A { has $.x where 1 }; say "alive"'
alive

$ perl6-m -e 'class A { has $x where 1; }; say "alive"'
alive

$ perl6 -e 'class A { has Int $.color where 1|2; }; say "alive"'
alive

STD also agrees:

$ viv -c -e 'class A { has Int $.color where 1|2; }'
 syntax OK

But before adding tests I wonder whether the where clause has any effect. 
Shouldn't the following complain that $.color is restricted to values 1 and 2?

$ perl6 -e 'class A { has Int $.color where 1|2 }; my $a = A.new( color => 3 ); 
say $a;'
A.new(color => 3)

Reply via email to