Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Work correctlywith new Moose versions

  • Loading branch information...
commit b72e3050a87e055f774f29a859cbe32caa7b5e98 1 parent debbce6
@bobtfish bobtfish authored
Showing with 13 additions and 3 deletions.
  1. +3 −0  Changes
  2. +10 −3 lib/MooseX/Role/WithOverloading/Meta/Role.pm
View
3  Changes
@@ -1,3 +1,6 @@
+ * Work around changes in composition_class_role in Moose >= 0.93_01
+ to be compatible with both old and new Moose versions.
+
0.04 Mon, 04 Jan 2010 18:40:11 +0100
* Depend on Test::More 0.88 for done_testing.
View
13 lib/MooseX/Role/WithOverloading/Meta/Role.pm
@@ -1,12 +1,19 @@
package MooseX::Role::WithOverloading::Meta::Role;
# ABSTRACT: Roles which support overloading
+use Moose ();
use Moose::Role;
use aliased 'MooseX::Role::WithOverloading::Meta::Role::Composite', 'CompositionRole';
use namespace::autoclean;
-has '+composition_class_roles' => (
- default => [ CompositionRole ],
-);
+$Moose::VERSION >= 0.9301
+ ? around composition_class_roles => sub {
+ my ($orig, $self) = @_;
+ return $self->$orig,
+ CompositionRole;
+ }
+ : has '+composition_class_roles' => (
+ default => sub { [ CompositionRole ] },
+ );
1;
Please sign in to comment.
Something went wrong with that request. Please try again.