[Perl5-syntax] Adding Moose type checking to Method::Signatures

Buddy Burden barefootcoder at gmail.com
Mon Mar 7 07:55:32 GMT 2011


Michael,

> If you're declaring named methods, MS is going to yell at you immediately at
> compile time and you're going to fix whether it's a warning or an error.
>
> I think the only time this will really matter is if your code generates
> anonymous methods on the fly.  In that case, you can trap the error.
>
> The reason you'd want a warning is so you can write methods using features
> that aren't implemented.  The argument is that the features of MS are all
> restrictive and not having them work doesn't change how the code works.  But
> we don't have a real use case for why you'd want to do that.  And we don't
> plan on leaving anything unimplemented.
>
> So just die.

Okey dokey.  I'll just change my warn to a die (or, more accurately,
my carp to a croak) and change Test::Warn to Test::Exception and that
should pretty much be it.  What do you want to change "{ warn => 0 }"
to? "{ die => 0 }"?  That doesn't seem right.  Maybe something longer,
to make it more obvious that you're doing something subversive?
Perhaps "{ no_fatal_unimplemented_type_errors => 1 }" or somesuch?


            -- Buddy



More information about the Perl5-syntax mailing list