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
use warnings FATAL => 'all' causes wrong syntax error diagnostics #14235
Comments
From @jimavCreated by @jimavThis is a bug report for perl from jim.avera@gmail.com, ----------------------------------------------------------------- I never noticed this until now, and I recently upgraded from The following script produces _only_ the bogus diagnostic Number found where operator expected at test.pl line 17, near "myfunc 1" However, if the FATAL => 'all' is removed, then the reference to #!/usr/bin/perl $misspelled = @ARGV; #. sub myfunc(@) { } sub bar { myfunc 1,2,3 ; }; Perl Info
|
From @cpansproutOn Wed Nov 12 23:45:15 2014, jim.avera@gmail.com wrote:
$ pbpaste|perl5.8.7 It looks as though we have already addressed this. But I do wonder when ‘Number found’ disappeared. I am also surprised that it changed in 5.18. Thank you for the report. This is an area that definitely needs more tests, so I’ll steal some of your code for that purpose. :-) -- Father Chrysostomos |
The RT System itself - Status changed from 'new' to 'open' |
From @cpansproutOn Thu Nov 13 04:41:19 2014, sprout wrote:
That’s still not quite right. We can’t say ‘Global symbol $foo requires explicit package name, do you need to predeclare bar?’ The ‘Number found...’ should not be omitted if we are going to say ‘Do you need to predeclare?’ I have addressed that in b255a11.
It was most likely v5.17.1-23-ga73ef99 that changed it. This bogus message is happening because we no longer allow sub declarations to have any effect after an error, as that can be a source of problems elsewhere: $ perl5.14.4 -lMstrict -e 'eval q|$foo; sub myfunc {}|; print $::{myfunc} // "undef"' But that does lead to bogus warnings at compile time. So I wonder whether we should go back to leaving sub stubs outside of an eval. -- Father Chrysostomos |
From @karenetheridgeOn Wed Nov 12 23:45:15 2014, jim.avera@gmail.com wrote:
I wonder if this is related to https://rt-archive.perl.org/perl5/Ticket/Display.html?id=121834. |
From @cpansproutOn Thu Nov 13 09:56:40 2014, ether wrote:
No. #121834 is about ‘once’ warnings being delayed until after the main program has compiled, so the fatality is no longer in scope when the warning happens. This bug is about fatal warnings during compilation suppressing the actual syntax error messages. We have mostly fixed that in blead, but the behaviour is still not quite satisfactory. -- Father Chrysostomos |
Migrated from rt.perl.org#123195 (status was 'open')
Searchable as RT123195$
The text was updated successfully, but these errors were encountered: