From: Yuval Kogman Date: Mon, 14 Apr 2008 01:16:46 +0000 (+0000) Subject: allow isa => SomeRandomClass in +foo attr declarations X-Git-Tag: 0_55~222 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d40ce9d515ec860f823af2474ada7d88bbae1ce8;p=gitmo%2FMoose.git allow isa => SomeRandomClass in +foo attr declarations --- diff --git a/lib/Moose/Meta/Attribute.pm b/lib/Moose/Meta/Attribute.pm index be577f8..6ec176d 100644 --- a/lib/Moose/Meta/Attribute.pm +++ b/lib/Moose/Meta/Attribute.pm @@ -78,9 +78,7 @@ sub clone_and_inherit_options { $type_constraint = $options{isa}; } else { - # FIXME this causes a failing test, not sure it should - # $type_constraint = Moose::Util::TypeConstraints::find_or_create_isa_type_constraint($options{isa}); - $type_constraint = Moose::Util::TypeConstraints::find_or_parse_type_constraint($options{isa}); + $type_constraint = Moose::Util::TypeConstraints::find_or_create_isa_type_constraint($options{isa}); (defined $type_constraint) || confess "Could not find the type constraint '" . $options{isa} . "'"; } @@ -95,9 +93,7 @@ sub clone_and_inherit_options { $type_constraint = $options{does}; } else { - # FIXME see above - # $type_constraint = Moose::Util::TypeConstraints::find_or_create_does_type_constraint($options{does}); - $type_constraint = Moose::Util::TypeConstraints::find_or_parse_type_constraint($options{does}); + $type_constraint = Moose::Util::TypeConstraints::find_or_create_does_type_constraint($options{does}); (defined $type_constraint) || confess "Could not find the type constraint '" . $options{does} . "'"; } diff --git a/t/020_attributes/009_attribute_inherited_slot_specs.t b/t/020_attributes/009_attribute_inherited_slot_specs.t index 4f9adde..4efb792 100644 --- a/t/020_attributes/009_attribute_inherited_slot_specs.t +++ b/t/020_attributes/009_attribute_inherited_slot_specs.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 84; +use Test::More tests => 83; use Test::Exception; BEGIN { @@ -102,10 +102,6 @@ BEGIN { ::dies_ok { has '+other_fail' => (weak_ref => 1); } '... cannot create an attribute with an illegal option'; - ::dies_ok { - has '+other_fail' => (isa => 'WangDoodle'); - } '... cannot create an attribute with a non-existent type'; - } my $foo = Foo->new;