-
Notifications
You must be signed in to change notification settings - Fork 1
Only a line number is printed when assigning to immutable values (stuff; $x = 42; stuff) #5376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
From @AlexDanielCode: Result: Line 2, right, but where exactly? Surely it can also print the cursor position or something. |
From @AlexDanielRight. After thinking about it, I now realize that almost any run-time error is giving such LTA error message. Perhaps instead of storing just the line number it should store something else, maybe the global position in the file or something. So that it can give an error with up to semicolon precision, not just the line number. Maybe the title of this bug report should be changed to something more general. |
From @lizmat
We don’t have the $/.CURSOR around at runtime. So in order to show where it happened in the line, one would have to also put that info in the opcodes. That feels like bloat to me. Workaround: put the assignments on different lines :-) Liz |
The RT System itself - Status changed from 'new' to 'open' |
From 1parrota@gmail.comI concur. The language shouldn't bend over backwards to accommodate bad habits. On 6/15/16, Elizabeth Mattijsen <liz@dijkmat.nl> wrote:
|
From @AlexDanielOn Wed Jun 15 16:24:04 2016, 1parrota@gmail.com wrote:
Bad habits like what? Using a one liner in your command line? Or using camelia on IRC? Sure, you can avoid it, but it does not make the error message any more awesome. As for the implementation, I don't know. It would be sad if there's no easy way to fix it. But at the same time I'm not sure why it is possible to hold the line number without any problems but having some additional information (maybe even stored in the same int) is such a big problem. |
From @ninerWell we would have to annotate MAST and JAST nodes with the column information in addition to the line number. The column is surprisingly easy to get by replacing: lineof actually calls line_and_column_of and just discards the column data. So the cost is one annotate per node and a couple of minutes of coding time. Benchmarks would show if it's worth it. Or maybe jnthn can shoot it down even earlier by telling is that this would cost a lot ;) |
Migrated from rt.perl.org#128402 (status was 'open')
Searchable as RT128402$
The text was updated successfully, but these errors were encountered: