Skip to content

Instantly share code, notes, and snippets.

@melo
Last active December 15, 2015 11:19
Show Gist options
  • Save melo/5252311 to your computer and use it in GitHub Desktop.
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 one is ok, sub is defined at compile time
package C1;
use Moo;
with 'R';
sub m {}
1;
## 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 one is ok
package C3;
use Moo;
use Method::Signatures::Simple;
method m () {}
with 'R';
1;
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