Last active
December 15, 2015 11:19
-
-
Save melo/5252311 to your computer and use it in GitHub Desktop.
Roles check the require's a bit too soon for my taste
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
## This one is ok, sub is defined at compile time | |
package C1; | |
use Moo; | |
with 'R'; | |
sub m {} | |
1; |
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
## This one will die, with checks requires before method is allowed to do its thing | |
package C2; | |
use Moo; | |
use Method::Signatures::Simple; | |
with 'R'; | |
method m () {} | |
1; |
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
## This one is ok | |
package C3; | |
use Moo; | |
use Method::Signatures::Simple; | |
method m () {} | |
with 'R'; | |
1; |
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 Moo::Role; | |
requires 'm'; | |
1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment