X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMooseX%2FTypes%2FUndefinedType.pm;h=97e403193266fddb9d5c36dff3dd679861965f89;hb=28696c2e1c3e499b4613645f4d6ec02026c025aa;hp=58f5d3e8eae9e2fc1971e67d862f81abca53ac59;hpb=ef8b7b7a254653b0e77d19b19d7bd870700cf4b2;p=gitmo%2FMooseX-Types.git diff --git a/lib/MooseX/Types/UndefinedType.pm b/lib/MooseX/Types/UndefinedType.pm index 58f5d3e..97e4031 100644 --- a/lib/MooseX/Types/UndefinedType.pm +++ b/lib/MooseX/Types/UndefinedType.pm @@ -1,7 +1,5 @@ package MooseX::Types::UndefinedType; -=cut - use warnings; use strict; @@ -44,14 +42,6 @@ sub name { return $_[0]->{name}; } -=head2 can_be_inlined - -Always returns false. Needed for compatbility with Moose 2.0100+. - -=cut - -sub can_be_inlined { 0 } - =head2 __autovivify Try to see if the type constraint has yet been defined and if so create it. @@ -70,6 +60,22 @@ sub __autovivify { } } +=head2 can_be_inlined + +Make sure that if a type hasn't been defined yet when Moose wants to inline it, +we don't allow inlining. + +=cut + +sub can_be_inlined { + my $self = shift; + if(my $type_constraint = $self->__autovivify) { + return $type_constraint->can_be_inlined; + } else { + return; + } +} + =head2 AUTOLOAD Try to autovivify and delegate