Skip to content

Commit

Permalink
Throw useful error on attribute in where
Browse files Browse the repository at this point in the history
…when trying to use such a `where` to constrain an attribute.

Fixes RT#130748: https://rt.perl.org/Ticket/Display.html?id=130748

If we're declaring a `has` variable, null $*HAS_SELF when we're
parsing the `where` clause for it.
  • Loading branch information
zoffixznet committed Feb 9, 2018
1 parent 28fabe3 commit 1c894e4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Perl6/Grammar.nqp
Expand Up @@ -2752,7 +2752,9 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
]?
[ <.ws> <trait>+ ]?
[ <.ws> <post_constraint('var')>+ ]?
[ <.ws> :my $*HAS_SELF :=
$*SCOPE eq 'has' ?? nqp::null !! nqp::getlexdyn('$*HAS_SELF')
; <post_constraint('var')>+ ]?
}
proto token routine_declarator { <...> }
Expand Down

0 comments on commit 1c894e4

Please sign in to comment.