Created
July 3, 2012 18:06
-
-
Save berekuk/3041446 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package R; | |
| use Moose::Role; | |
| has "foo" => ( | |
| is => "ro", | |
| required => 1, | |
| default => 5 | |
| ); | |
| package X; | |
| use Moose; | |
| with "R"; | |
| has "+foo" => ( | |
| builder => "_build_foo" | |
| ); | |
| sub _build_foo { 6 } | |
| #### Setting both default and builder is not allowed. at /usr/lib/perl5/Class/MOP/Attribute.pm line 46. | |
| package R; | |
| use Moose::Role; | |
| has "foo" => ( | |
| is => "ro", | |
| required => 1, | |
| builder => "_build_foo", | |
| ); | |
| sub _build_foo { 5 } | |
| package X; | |
| use Moose; | |
| with "R"; | |
| has "+foo" => ( | |
| default => 6 | |
| ); | |
| #### Setting both default and builder is not allowed. at /usr/lib/perl5/Class/MOP/Attribute.pm line 46. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment