Skip Menu |
Report information
Id: 131333
Status: open
Priority: 0/
Queue: perl6

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

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



Subject: use of undeclared attributes gives not useful line number in error
Date: Sat, 20 May 2017 13:20:02 +0200
From: Marcel Timmerman <mt1957 [...] gmail.com>
To: rakudobug [...] perl.org
Download (untitled) / with headers
text/plain 616b
in perl version 2017.04.3-287-g3e7675a built on MoarVM version 2017.04-64-g6d5ea04 implementing Perl 6.c I see the following error; t/120-Decimal128.t .. ===SORRY!=== Error while compiling /home/marcel/Languages/Perl6/Projects/BSON/lib/BSON/Decimal128.pm6 (BSON::Decimal128) Attribute $!sstring not declared in class BSON::Decimal128 at /home/marcel/Languages/Perl6/Projects/BSON/lib/BSON/Decimal128.pm6 (BSON::Decimal128):92 This is a writing error of course of attribute $!string. The line number however, was at the end of the module and not at the (first) location where it is used. Regards, marcel
Subject: Re: [perl #131333] use of undeclared attributes gives not useful line number in error
Date: Sat, 20 May 2017 13:28:28 +0200
From: Elizabeth Mattijsen <liz [...] dijkmat.nl>
To: "mt1957 (via RT)" <perl6-bugs-followup [...] perl.org>
Download (untitled) / with headers
text/plain 1.1k
Show quoted text
> On 20 May 2017, at 13:20, mt1957 (via RT) <perl6-bugs-followup@perl.org> wrote: > > # New Ticket Created by mt1957 > # Please include the string: [perl #131333] > # in the subject line of all future correspondence about this issue. > # <URL: https://rt.perl.org/Ticket/Display.html?id=131333 > > > > in perl version 2017.04.3-287-g3e7675a built on MoarVM version > 2017.04-64-g6d5ea04 > implementing Perl 6.c I see the following error; > > > t/120-Decimal128.t .. ===SORRY!=== Error while compiling > /home/marcel/Languages/Perl6/Projects/BSON/lib/BSON/Decimal128.pm6 > (BSON::Decimal128) > Attribute $!sstring not declared in class BSON::Decimal128 > at /home/marcel/Languages/Perl6/Projects/BSON/lib/BSON/Decimal128.pm6 > (BSON::Decimal128):92 > > > This is a writing error of course of attribute $!string. The line > number however, was at the end of the module and not at the (first) > location where it is used.
Fixing this would involve remembering where an attribute was first mentioned, as this is fully legal: class A { method a { $!a }; has $!a } aka, specifying the attribute *after* it was mentioned. So it wouldn’t know it wasn’t defined until it hit the end of the class.


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