Mouse::Util::does_role() respects $thing->does() method
[gitmo/Mouse.git] / example / warns.pl
1 #!perl
2 package Point;
3 use Mouse;
4 use MouseX::StrictConstructor;
5
6 # extra 'unknown_attr' is supplied (WARN)
7 has 'x' => (isa => 'Int', is => 'rw', required => 1, unknown_attr => 1);
8
9 # mandatory 'is' is not supplied (WARN)
10 has 'y' => (isa => 'Int', required => 1);
11
12 sub clear {
13   my $self = shift;
14   $self->x(0);
15   $self->y(0);
16 }
17
18 __PACKAGE__->meta->make_immutable();
19
20 package main;
21
22 # extra 'z' is supplied (FATAL)
23 my $point1 = Point->new(x => 5, y => 7, z => 9);