Skip Menu |

This queue is for tickets about the Type-Tiny CPAN distribution.

Report information
The Basics
Id: 114915
Status: resolved
Priority: 0/
Queue: Type-Tiny

People
Owner: perl [...] toby.ink
Requestors: haarg [...] haarg.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: Mismatch in isa vs can for parameterized types
Parameterized type constraints will return true from a check like $tc->isa('Moose::Meta::TypeConstraint::Parameterized'), however calls to $tc->can for some things will fail even though that class provides them. For example, $tc->can('parameterized_from') will return undef. This is partly because the $tc->moose_type is a Moose::Meta::TypeConstraint rather than a parameterized variant.
On 2016-05-31T19:50:58+01:00, haarg wrote: Show quoted text
> Parameterized type constraints will return true from a check like $tc-
> >isa('Moose::Meta::TypeConstraint::Parameterized'), however calls to
> $tc->can for some things will fail even though that class provides > them. For example, $tc->can('parameterized_from') will return undef. > > This is partly because the $tc->moose_type is a > Moose::Meta::TypeConstraint rather than a parameterized variant.
Not sure whether the best solution is to make `can` more complicated, make `moose_type` more complicated, or implement the missing bits of functionality from Moose::Meta::TypeConstraint::Parameterized.
Implemented missing methods in repo.
Fixed in Type::Tiny 1.007_xxx.