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