diff --git a/src/Perl6/Actions.nqp b/src/Perl6/Actions.nqp index 5371e558559..b286ab331cf 100644 --- a/src/Perl6/Actions.nqp +++ b/src/Perl6/Actions.nqp @@ -5160,7 +5160,7 @@ Compilation unit '$file' contained the following violations: $target := $target[0]; } unless nqp::istype($target, QAST::Op) && ($target.op eq 'call' || $target.op eq 'callmethod') { - $/.CURSOR.typed_panic('X::Syntax::Adverb'); + $/.CURSOR.typed_panic('X::Syntax::Adverb', what => $target.name); } my $cpast := $.ast; $cpast[2].named(compile_time_value_str($cpast[1], 'LHS of pair', $/)); diff --git a/src/core/Exception.pm b/src/core/Exception.pm index 0bd2392e699..9bb40f4f041 100644 --- a/src/core/Exception.pm +++ b/src/core/Exception.pm @@ -1143,7 +1143,9 @@ my class X::Syntax::CannotMeta does X::Syntax { } my class X::Syntax::Adverb does X::Syntax { - method message() { "You can't adverb that" } + has $.what; + + method message() { "You can't adverb " ~ ($.what // "that") } } my class X::Syntax::Regex::Adverb does X::Syntax {