Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Removing parameterless method-call candidate
The parameterless candidate didn't take multi-dispatch resolution into account properly. However, we might get that for free from the other candidate if we allow the empty Capture as the default third argument.
  • Loading branch information
2colours committed Nov 24, 2022
1 parent 32955b9 commit 6b124c6
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/CoreHackers/Sourcery.rakumod
Expand Up @@ -10,7 +10,7 @@ my constant $Commit = do with $*RAKU.compiler.version.Str -> $v is copy {
$v.split('g').tail
}

multi sourcery($thing, Str:D $method, Capture:D $c) {
multi sourcery($thing, Str:D $method, Capture:D $c = \()) {
for $thing.^can($method) -> $meth {
with $meth.cando(\($thing, |$c)).first(*.defined) {
return do-sourcery($_);
Expand All @@ -19,9 +19,6 @@ multi sourcery($thing, Str:D $method, Capture:D $c) {
die "Could not find candidate that can do $c.gist()";
}

multi sourcery(Mu $thing, Str:D $method) {
do-sourcery $thing.^can($method).head
}
multi sourcery(&code) { do-sourcery &code }
multi sourcery(&code, Capture $c) {
do-sourcery &code.cando($c).head
Expand Down

0 comments on commit 6b124c6

Please sign in to comment.