in reply to Passing Str or undef ?
use MooseX::Declare; class Foo { method baz(Str|Undef $x) { say $x // '[undef]'; } }; Foo->new->baz($_) for undef, "hi", [], {}; __END__ [undef] hi Validation failed for 'Tuple[Tuple[Object,Str|Undef],Dict[]]' with val +ue [ [ Foo=HASH(0x2645708), ARRAY(0x101e2... [+] Validation failed for 'Str' with value ARRAY(0x2105220) and Vali +dation failed for 'Undef' with value...
MXD uses MooseX::Method::Signatures so I guess you'll be able to adapt the code above.
|
|---|