Skip Menu |

This queue is for tickets about the MooseX-AlwaysCoerce CPAN distribution.

Report information
The Basics
Id: 58857
Status: open
Priority: 0/
Queue: MooseX-AlwaysCoerce

People
Owner: Nobody in particular
Requestors: mschwern [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.04
Fixed in: (no value)



MooseX::Method::Signatures has coercion off by default. This is annoying and I wind up writing "does coerce" a lot. For example: { package Baz; use Moose; use MooseX::Types::Path::Class; use MooseX::Method::Signatures; use MooseX::AlwaysCoerce; method foo(Path::Class::Dir $dir) { return $dir->parent; } } my $obj = Baz->new; print $obj->foo("/this/that"); The above fails validation unless "does coerce" is added to the signature. It would be great if MooseX::AlwaysCoerce could turn on coercion in signatures.
On Sat Jun 26 14:57:02 2010, MSCHWERN wrote: Show quoted text
> It would be great if MooseX::AlwaysCoerce could turn on coercion in > signatures.
This is unlikely to happen, as coercion is off by default in vanilla Moose, so would likely cause confusion if turned on in signatures. However it *should* be possible to enable coercion for a specific signature definition. I haven't used MXMS in new code for a while, so I fail to recollect if this feature exists yet -- but it ought to.
On Mon Nov 12 11:52:55 2012, ETHER wrote: Show quoted text
> On Sat Jun 26 14:57:02 2010, MSCHWERN wrote: >
> > It would be great if MooseX::AlwaysCoerce could turn on coercion in > > signatures.
> > This is unlikely to happen, as coercion is off by default in vanilla > Moose, so would likely cause confusion if turned on in signatures.
Er forget what I said here; I forgot this is in the MXAC queue, not the MXMS queue. :)