develooper Front page | perl.perl5.porters | Postings from February 2018

Re: [perl #132760] Blead Breaks CPAN: YANICK/List-Lazy-0.3.0.tar.gz

Thread Previous | Thread Next
February 15, 2018 19:06
Re: [perl #132760] Blead Breaks CPAN: YANICK/List-Lazy-0.3.0.tar.gz
Message ID:
I wrote:
>I'd be satisfied if the real error at least were the first one emitted.

Looking more closely, the reason why the real error isn't emitted first
is that it's queued up through the qerror() system.  This is a deliberate
move to collect up multiple compilation errors, so that multiple errors
can be reported even if errors are being reported by means other than
emitting a message to stderr.  For example, an eval() that encounters
multiple compilation errors will yield a $@ that contains multiple
concatenated error messages.  (And indeed, multiple errors do occur
with List::Lazy.)

The reason why some other messages appear before the errors is that the
earlier messages aren't errors, they're warnings.  These go straight to
stderr as they arise, rather than being collected with the errors.

All of these bits of behaviour are individually intentional, but they
have the undesirable effect of losing synchronisation between the warning
stream and the error stream.  This can't be fixed without some fairly big
change to the way compile-time diagnostics are managed.  We could perhaps
abandon the queuing of errors, aborting compilation immediately on the
first error; in this case that would lead to emitting the "syntax error"
message and nothing else.  Doing that would inevitably garner complaints
about situations in which multiple error messages are actually helpful.
Any approach around shuffling the order in which messages are emitted
would be hideously complicated.  Maybe we could do something else to
distinguish between warnings and errors, to draw greater attention to
the first error even if it's not the first message emitted.

We can't fix this for 5.28.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About