Skip Menu |
Report information
Id: 131972
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: dzwell [at] gmail.com
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



To: rakudobug [...] perl.org
Date: Sun, 27 Aug 2017 11:55:44 +0000
From: Dan Zwell <dzwell [...] gmail.com>
Subject: [BUG] misleading grammar error output when referring to a missing rule with a similarly named sub-rule
Download (untitled) / with headers
text/plain 616b
Version: Rakudo version 2017.08-14-gf097e551b built on MoarVM version 2017.08.1-32-gcd41322e
implementing Perl 6.c.

When running the attached script, the error output should be:
No such method 'hash' for invocant of type 'Matcher'

Instead, the error given is:
P6opaque: no such attribute '$!pos' in type Match when trying to get a value

Test case:

grammar Matcher {
    rule TOP { <hash> }
    proto rule atom {*}
    rule atom:sym<hash> { . }
}
Matcher.parse('x'); # Generates the wrong error.
'x' ~~ /<Matcher::TOP>/; # Generates the same error as above.
'x' ~~ /<Matcher::hash>/; # Generates the right error.



This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org