Skip Menu |

This queue is for tickets about the Type-Tiny CPAN distribution.

Report information
The Basics
Id: 90867
Status: resolved
Priority: 0/
Queue: Type-Tiny

People
Owner: perl [...] toby.ink
Requestors: djerius [...] cpan.org
Cc:
AdminCc:

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



Subject: possible documentation error in Error::TypeTiny::Assertion
The documentation for explain() indicates it returns undef if no explanation is possible. It also seems to return an empty array ref, which would imply the same thing. sub explain { my $e = shift; return [] unless $e->has_type; $e->type->validate_explain($e->value, $e->varname); } Are both possible, or does it only return an empty array ref (with the documentation being incorrect)? Thanks, Diab
On 2013-11-28T02:25:01Z, DJERIUS wrote: Show quoted text
> Are both possible, or does it only return an empty array ref (with the > documentation being incorrect)?
$e->type->validate_explain can theoretically return undef; though it's not easy to trigger that unless you define some seriously silly type constraints (e.g. which use a random number to determine whether a value passes or fails!) I'll replace that first [] with an undef to make the documentation more correct.
Fixed in 0.034.