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=eca9111284ed762c51b57fe1468c8ecce9513f97;hpb=9fd376471e35369998008c1ea620f2e3febaa001;p=gitmo%2FMooseX-Types.git diff --git a/lib/MooseX/Types/UndefinedType.pm b/lib/MooseX/Types/UndefinedType.pm index eca9111..97e4031 100644 --- a/lib/MooseX/Types/UndefinedType.pm +++ b/lib/MooseX/Types/UndefinedType.pm @@ -42,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. @@ -68,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