From: Graham Knop <haarg@haarg.org>
Date: Sun, 5 May 2013 14:26:15 +0000 (-0400)
Subject: when inhaling Moose roles, only include original options for attributes
X-Git-Tag: v1.003000~79
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=358c29e151ff396b38a8af5a6cedc750ce98a8d9;p=gitmo%2FMoo.git

when inhaling Moose roles, only include original options for attributes
---

diff --git a/lib/Moo/Role.pm b/lib/Moo/Role.pm
index 1be78e2..07c32a7 100644
--- a/lib/Moo/Role.pm
+++ b/lib/Moo/Role.pm
@@ -119,12 +119,14 @@ sub _inhale_if_moose {
     $INFO{$role}{requires} = [ $meta->get_required_method_list ];
     $INFO{$role}{attributes} = [
       map +($_ => do {
-        my $spec = { %{$meta->get_attribute($_)} };
+        my $attr = $meta->get_attribute($_);
+        my $is_mouse = $meta->isa('Mouse::Meta::Role');
+        my $spec = { %{ $is_mouse ? $attr : $attr->original_options } };
 
         if ($spec->{isa}) {
 
           my $get_constraint = do {
-            my $pkg = $meta->isa('Mouse::Meta::Role')
+            my $pkg = $is_mouse
                         ? 'Mouse::Util::TypeConstraints'
                         : 'Moose::Util::TypeConstraints';
             _load_module($pkg);