Skip to content

Instantly share code, notes, and snippets.

@jnthn
Created April 4, 2015 19:37
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 jnthn/67a5c42a0ce9a1ba2424 to your computer and use it in GitHub Desktop.
Save jnthn/67a5c42a0ce9a1ba2424 to your computer and use it in GitHub Desktop.
use Test;
plan 3;
multi foo(Int() $) { 1 }
multi foo(Cool $) { 2 }
is foo(42), 1, 'Int hits Int() candidate as if it were an Int candidate';
is foo("omg"), 2, 'Str hits Cool candidate';
is foo(set()), 1, 'Set hits Int() candidate due to it accepting Any and coercing';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment