* changes for MooseX::IOC
[gitmo/MooseX-AttributeHelpers.git] / lib / MooseX / AttributeHelpers / Collection / Hash.pm
index 684a1c5..1131ae8 100644 (file)
@@ -35,8 +35,14 @@ sub _process_options_for_provides {
     my ($self, $options) = @_;    
     (exists $options->{isa})
         || confess "You must define a type with the Hash metaclass";  
-         
-    (find_type_constraint($options->{isa})->is_a_type_of('HashRef'))
+
+    my $isa = $options->{isa}; 
+
+    unless (blessed($isa) && $isa->isa('Moose::Meta::TypeConstraint')) {
+        $isa = find_type_constraint($isa);        
+    }
+
+    ($isa->is_a_type_of('HashRef'))
         || confess "The type constraint for a Hash ($options->{isa}) must be a subtype of HashRef";
 }