restricted code
[gitmo/Role-Tiny.git] / lib / Role / Tiny / Restricted.pm
CommitLineData
73cc2ff3 1package Role::Tiny::Restricted;
2
3use strict;
4use warnings FATAL => 'all';
5use base qw(Role::Tiny);
6
7sub apply_union_of_roles_to_package {
8 my ($me, $to, @roles) = @_;
9 my %app = %{$Role::Tiny::APPLIED_TO{$to}||{}};
10 delete $app{$to};
11 if (%app) {
12 require Carp;
13 Carp::confess("with() may not be called more than once for $to");
14 }
15 $me->SUPER::apply_union_of_roles_to_package($to, @roles);
16}
17
181;