The Bool check was implemented inconsistently between Type::Tiny, Type::Tiny::XS, Moose, and Mouse. Additionally the Moose documentation possibly implies different behaviour to its implementation.
As of Types::Standard 1.004000 and Type::Tiny::XS 0.014, Bool accepts the following four values and no others:
""
"0"
"1"
undef
You can use coerce=>1 to accept other values and coerce it to an acceptable value.
The behaviour of Mouse (and older versions of Type::Tiny::XS which is based on Mouse's type checking code) was to accept objects overloading boolification BUT ONLY FOR FALSE, NOT FOR TRUE!
The behaviour of Moose (and older versions of Types::Standard) was to accept objects overloading STRINGIFICATION (not boolification!) to return one of the allowed string values.
Mouse's behaviour of only accepting overloaded objects if they returned false was clearly stupid.
Moose's behaviour of accepting overloaded objects but using their string overload instead of boolean overload is also fairly stupid.
So I decided to stick strictly to what Moose::Manual::Types says:
Show quoted text > "Bool" accepts 1 for true, and undef, 0,
> or the empty string as false.
Other values, including overloaded objects, now fail the constraint.
If you set coerce=>1, then you can accept any value, and it will be coerced like !!$value, yielding a simple boolean.
An alternative, if you don't want to do coercion would be something like:
isa => Bool | InstanceOf['JSON::PP::Boolean']
or more generally:
isa => Bool | Overload["bool"]
or a little faster if you trust your user not to send stupid objects which make no sense:
isa => Bool | Object
or even faster if you just don't care:
isa => Any
But anyway, this change was deliberate and is documented, so rejecting this issue.