Skip to content

Commit

Permalink
Make &dd more resilient to low-level stuff
Browse files Browse the repository at this point in the history
Stuff like
   dd nqp::getattr(-> Int(Cool) $ {}.signature.params.head,
        Parameter, q|$!coerce_method|)
that crashes because there's no .dispatch:<.?> nor .perl
methods on this object.

Fix by wrapping those calls into `try` and marking such things
with "low level" in output.
  • Loading branch information
zoffixznet committed Jan 7, 2018
1 parent a0634e5 commit 9992374
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/Any.pm
Expand Up @@ -605,9 +605,9 @@ sub dd(|) {
my $var := nqp::shift($args);
my $name := try $var.VAR.?name;
my $type := $var.WHAT.^name;
my $what := $var.?is-lazy
my $what := (try $var.?is-lazy)
?? $var[^10].perl.chop ~ "... lazy list)"
!! $var.perl;
!! (try $var.perl) // "(low-level $var.^name())";
note $name ?? "$type $name = $what" !! $what;
}
}
Expand Down

0 comments on commit 9992374

Please sign in to comment.