houseabsolute / Params-ValidationCompiler

Build an optimized subroutine parameter validator once, use it forever
https://metacpan.org/release/Params-ValidationCompiler/
Other
4 stars 5 forks source link

Type::Tiny warnings #14

Closed xenu closed 7 years ago

xenu commented 7 years ago

Following code produces Found = in conditional, should be == at (eval 79) line 55. warning:

use Types::Standard qw( Dict Int );
use Params::ValidationCompiler qw( validation_for );

my $validator = validation_for(
    params => {
        foo => { type => Dict[name => Int] },
    }
);

Not sure what's the right way to fix it. I feel that it should be fixed in Type::Tiny, but TOBYINK doesn't seem to agree (see this issue).

Maybe Params::ValidationCompiler should add no warnings to inlined type checks/coercions?

autarch commented 7 years ago

I'm a bit wary of disabling warnings since people could be creating typed with inclining where the warnings world reveal real issues. It really seems like TT should lexically disable warnings in the code it generates if it knows it might warn.

xenu commented 7 years ago

Oohh, sorry, looks like it is fixed in the latest dev release of Type::Tiny. The fix didn't make it to the stable branch yet :)

Closing.