Subject: | Using type as params value can be surprising |
If you attempt to use a type as the value to params, it will be used as a boolean value indicating that the parameter is required. This isn't really incorrect, but can be misleading.
use MooseX::Types::Moose qw(Int);
validation_for(
params => {
some_param => Int,
},
);
If you see code like this, you would expect it to restrict to a specific type, but that isn't what it ends up doing.
I think it would be good if P::VC could warn about this case.