Skip to content

Commit

Permalink
Restore suggestions for unknown symbols.
Browse files Browse the repository at this point in the history
Something is getting passed to .join that is not a Str, nor can we
call a .Str method on it, but we can box it as a Str.
  • Loading branch information
perlpilot committed Aug 19, 2015
1 parent 59be37a commit 7880bb8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/core/Exception.pm
Expand Up @@ -770,8 +770,7 @@ my class X::Undeclared::Symbols does X::Comp {
'used at line' ~ (@lu == 1 ?? ' ' !! 's ') ~ @lu.join(', ')
}
sub s(@s) {
# XXX GLR this dies when trying to stringify, even though @s is just the List ("sec")
#"Did you mean '{ @s.join("', '") }'?";
"Did you mean '{ @s.join("', '") }'?";
}
my $r = "";
if %.post_types {
Expand Down
6 changes: 4 additions & 2 deletions src/core/List.pm
Expand Up @@ -733,8 +733,10 @@ my class List does Iterable does Positional { # declared in BOOTSTRAP
my int $n = nqp::elems($!reified);
while $i < $n {
$tmp := nqp::ifnull(nqp::atpos($!reified, $i), Any);
nqp::push_s($rsa,
nqp::unbox_s(nqp::istype($tmp, Str) && nqp::isconcrete($tmp) ?? $tmp !! $tmp.Str));
# Not sure why this works
nqp::push_s($rsa, nqp::unbox_s(nqp::istype($tmp, Str) && nqp::isconcrete($tmp) ??
$tmp !!
nqp::can($tmp, 'Str') ?? $tmp.Str !! nqp::box_s($tmp, Str) ));
$i = $i + 1;
}
nqp::push_s($rsa, '...') if $infinite;
Expand Down

0 comments on commit 7880bb8

Please sign in to comment.