Skip to content

Commit

Permalink
Make method not found error reporting a little more resilient
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Jun 30, 2020
1 parent 8d2156b commit 0a86798
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core.c/Exception.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ my class X::Method::NotFound is Exception {
if nqp::can($!invocant.HOW, 'methods') {
my @invocant_methods = $!invocant.^methods(:local)>>.name;
for $!invocant.^methods(:all) -> $method_candidate {
my $method_name = $method_candidate.name;
my $method_name = (try $method_candidate.name) // '?';
# GH#1758 do not suggest a submethod from a parent
next if $method_candidate.^name eq 'Submethod' && !@invocant_methods.first($method_name, :k).defined;
my $dist = StrDistance.new(:before($.method), :after(~$method_name));
Expand Down

0 comments on commit 0a86798

Please sign in to comment.