MooseX::Role::Strict(3pm)

MooseX::Role::Strict3pm

Use strict 'roles'

Usage

This code will fail at composition time:

    {
        package My::Role;
        use MooseX::Role::Strict;
        sub conflict {}
    }
    {
        package My::Class;
        use Moose;
        with 'My::Role';
        sub conflict {}
    }

With an error message similar to the following:

    The class My::Class has implicitly overridden the method (conflict) from
    role My::Role ...

To resolve this, explicitly exclude the 'conflict' method:

    {
        package My::Class;
        use Moose;
        with 'My::Role' => { -excludes => [ 'conflict' ] };
        sub conflict {}
    }

Version

Version 0.05

Overview

WARNING: this is ALPHA code. More features to be added later.

When using Moose::Role, a class which provides a method a role provides will silently override that method. This can cause strange, hard-to-debug errors when the role's methods are not called. Simple use "MooseX::Role::Strict" instead of "Moose::Role" and overriding a role's method becomes a composition-time failure. See the synopsis for a resolution.

Support

You can find documentation for this module with the perldoc command.

    perldoc MooseX::Role::Strict

You can also look for information at:

•

RT: CPAN's request tracker

<http://rt.cpan.org/NoAuth/Bugs.html?Dist=MooseX-Role-Strict>

•

AnnoCPAN: Annotated CPAN documentation

<http://annocpan.org/dist/MooseX-Role-Strict>

•

CPAN Ratings

<http://cpanratings.perl.org/d/MooseX-Role-Strict>

•

Search CPAN

<http://search.cpan.org/dist/MooseX-Role-Strict/>

Acknowledgements

Todo

Add "-includes" to make things easier:

 with 'Some::Role' => { -includes => 'bar' };

That reverses the sense of '-excludes' in case you're more interested in the interface than the implementation. I'm unsure of the syntax for auto-converting a role to a pure interface.

Releases

6 releases since Debian 8 (Jessie); the text changed 3 times.

  1. 8
  2. 9–10
  3. 11
  4. 12–13

Author

Curtis "Ovid" Poe, "<ovid at cpan.org>"

Bugs

Please report any bugs or feature requests to "bug-moosex-role-strict at rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=MooseX-Role-Strict>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

From libmoosex-role-strict-perl 0.5-3 in Debian 13 (Trixie). Parsed by carta from the page's man source.