nextwith
ErrorsCollection

nextwith

Synthesised documentation from language/functions

From language/functions

See Original text in context

nextwith calls the next matching candidate with arguments provided by users and never returns.

proto a(|) {*}
 
multi a(Any $x{
    say "Any $x";
    return 5;
}
multi a(Int $x{
    say "Int $x";
    nextwith($x + 1);
    say "never executed because nextwith doesn't return";
}
 
a 1;        # OUTPUT: «Int 1␤Any 2␤»