Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add elems to suggestion list for length
As pointed out by TimToady++
  • Loading branch information
lizmat committed Mar 7, 2014
1 parent ef8b8f9 commit 55d5e36
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Perl6/World.nqp
Expand Up @@ -2388,6 +2388,7 @@ class Perl6::World is HLL::World {
@suggestions := @no_sigils;
}
if $name eq '&length' {
@suggestions.push: $with_sigil ?? '&elems' !! 'elems';
@suggestions.push: $with_sigil ?? '&chars' !! 'chars';
@suggestions.push: $with_sigil ?? '&graphs' !! 'graphs';
@suggestions.push: $with_sigil ?? '&codes' !! 'codes';
Expand Down
2 changes: 1 addition & 1 deletion src/core/Exception.pm
Expand Up @@ -74,7 +74,7 @@ my class X::Method::NotFound is Exception {
?? "No such private method '$.method' for invocant of type '$.typename'"
!! "No such method '$.method' for invocant of type '$.typename'";
if $.method eq 'length' {
$message ~= "\nDid you mean 'chars', 'graphs' or 'codes'?";
$message ~= "\nDid you mean 'elems', 'chars', 'graphs' or 'codes'?";
}
elsif $.method eq 'bytes' {
$message ~= "\nDid you mean '.encode(\$encoding).bytes'?";
Expand Down

0 comments on commit 55d5e36

Please sign in to comment.