make M:M:TC:Parameterized->equals("Unregistered") work
[gitmo/Moose.git] / lib / Moose / Meta / TypeConstraint / Parameterized.pm
index 61db448..65bf696 100644 (file)
@@ -13,17 +13,19 @@ use base 'Moose::Meta::TypeConstraint';
 __PACKAGE__->meta->add_attribute('type_parameter' => (
     accessor  => 'type_parameter',
     predicate => 'has_type_parameter',
+    Class::MOP::_definition_context(),
 ));
 
 __PACKAGE__->meta->add_attribute('parameterized_from' => (
     accessor   => 'parameterized_from',
     predicate  => 'has_parameterized_from',
+    Class::MOP::_definition_context(),
 ));
 
 sub equals {
     my ( $self, $type_or_name ) = @_;
 
-    my $other = Moose::Util::TypeConstraints::find_type_constraint($type_or_name);
+    my $other = Moose::Util::TypeConstraints::find_or_create_type_constraint($type_or_name) or return;
 
     return unless $other->isa(__PACKAGE__);