Subject: | Wrong source line number reported for misspelled private class attribute names |
From: | "Yichun Zhang (agentzh)" <agentzh [...] gmail.com> |
Date: | Sat, 21 Jan 2017 16:47:36 -0800 |
To: | rakudobug [...] perl.org |
Hi there
I've just noted that Rakudo 2017.01 reports the wrong line number for
any references of misspelled private class attributes. The minimal
example to reproduce this is as follows:
class Foo {
method foo {
say $!bad;
}
}
Foo.foo();
Rakudo reports the following:
===SORRY!=== Error while compiling /home/agentzh/a.p6
Attribute $!bad not declared in class Foo
at /home/agentzh/a.p6:7
------> }⏏<EOL>
Note the line number is 7 while the offending line is at line 3. It
seems that rakudo always reports the last line of the containing
source file, which is never useful.
I haven't tested any other Rakudo releases yet. So I'm not sure if
it's a long standing issue or just a recent regression.
Thanks for your attention!
Best regards,
-agentzh