in reply to Perl6: Class attribute strict static type
Type-checking of attributes is not yet implemented in Rakudo. There's a branch of Rakudo that uses a new object model, which will make it very simple to implement attribute type checking. Expect it to land in the next two or three months.
Once that's done, you can say
subset Username of Str where none <admin root>; class User is rw { has Int $.id; has Username $.username; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl6: Class attribute strict static type
by dièze (Novice) on Jun 05, 2011 at 10:28 UTC |