In Functions§
See primary documentation in context for sub callsame.
callsame calls the next matching candidate with the same arguments that were used for the current candidate and returns that candidate's return value.
proto a(|) {*} multi a(Any $x) { say "Any $x"; return 5; } multi a(Int $x) { say "Int $x"; my $res = callsame; say "Back in Int with $res"; } a 1; # OUTPUT: «Int 1Any 1Back in Int with 5»