Skip to content

Instantly share code, notes, and snippets.

@tadzik
Created April 23, 2016 16:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tadzik/2001b1f3ec464b0448e62f3655b58ab2 to your computer and use it in GitHub Desktop.
Save tadzik/2001b1f3ec464b0448e62f3655b58ab2 to your computer and use it in GitHub Desktop.
diff --git a/src/core/Main.pm b/src/core/Main.pm
index 811b665..ceebcfd 100644
--- a/src/core/Main.pm
+++ b/src/core/Main.pm
@@ -175,6 +175,15 @@ my sub MAIN_HELPER($retval = 0) {
if +@matching_candidates {
$m(|@($p), |%($n));
return;
+ CATCH {
+ when X::AdHoc {
+ unless .backtrace[0].subname eq 'MAIN'
+ or .message.index('Constraint type check failed '
+ ~ 'for parameter') {
+ .rethrow;
+ }
+ }
+ }
}
# We could not find the correct MAIN to dispatch to!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment