Revision history for MooseX-Types
+0.19
+ - un-fix coercions on parameterized types, since it broke
+ MooseX::Method::Signatures, as well as any other code that relied on
+ new type constraint objects being generated each time a type was
+ parameterized (hdp).
+
0.18 Sat Aug 22 12:50:42 EDT 2009
- fix coercions on parameterized types (Hans Dieter Pearcey).
# It's obnoxious to have to parameterize before looking for the TC, but the
# alternative is to hard-code the assumption that the name is
# "$name[$args[0]]", which would be worse.
- if (my $existing =
- Moose::Util::TypeConstraints::find_type_constraint($parameterized->name)) {
- return $existing;
- }
- Moose::Util::TypeConstraints::register_type_constraint($parameterized);
+ # This breaks MXMS, unfortunately, which relies on things like Tuple[...]
+ # creating new type objects each time.
+ # if (my $existing =
+ # Moose::Util::TypeConstraints::find_type_constraint($parameterized->name)) {
+ # return $existing;
+ # }
+ # Moose::Util::TypeConstraints::register_type_constraint($parameterized);
return $parameterized;
}
my $instance = AClass->new;
+{ local $TODO = "see comments in MooseX::Types->create_arged_...";
lives_ok { $instance->parameterized('foo') }
'coercion applied to parameterized type';
+}
lives_ok { $instance->subtype_parameterized('foo') }
'coercion applied to subtype';