projects
/
gitmo/Moose.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
adding an error case for no matching (and tests)
[gitmo/Moose.git]
/
lib
/
Moose
/
Util
/
TypeConstraints.pm
diff --git
a/lib/Moose/Util/TypeConstraints.pm
b/lib/Moose/Util/TypeConstraints.pm
index
ac9b560
..
b5ff3f7
100644
(file)
--- a/
lib/Moose/Util/TypeConstraints.pm
+++ b/
lib/Moose/Util/TypeConstraints.pm
@@
-467,9
+467,11
@@
sub match_on_type {
return $action->($to_match);
}
}
+ (defined $default)
+ || __PACKAGE__->_throw_error("No cases matched for $to_match");
{
local $_ = $to_match;
- return $default->($to_match) if $default;
+ return $default->($to_match);
}
}