This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Consistency Error triggered by...

4 replies
Martin S. Weber
Joined: 2008-12-23,
User offline. Last seen 42 years 45 weeks ago.

the attached mini-program.

tst-case.scala:20: error: consistency problem in target generation ! I
have args List(temp7) and need to jump to a label with fmls List()

Why? What can I do to avoid it? Why do I get a consistency error and
not a normal compile error? Why doesn't the consistency error output
go to filedesc 2 (aka STDERR) so I can 2>&1 | less it? Should I create
a ticket for that?

..so many questions.

TIA..

(scala 2.7.3 here)
-Martin

Martin S. Weber
Joined: 2008-12-23,
User offline. Last seen 42 years 45 weeks ago.
Re: Consistency Error triggered by...

Quoting "Martin S. Weber" :

> the attached mini-program.
>
> tst-case.scala:20: error: consistency problem in target generation !
> I have args List(temp7) and need to jump to a label with fmls List()
> (...)

Ok, I see ticket 425 open (for over a year now) for that case already.
Questions remaining are, why doesn't the compiler (in general) output
errors like these on stderr? And is there any hope of this being fixed
somewhen soon? It makes swing'ing harder than it should be imo..

-Martin

extempore
Joined: 2008-12-17,
User offline. Last seen 35 weeks 3 days ago.
Re: Consistency Error triggered by...

On Wed, Mar 18, 2009 at 03:57:35PM -0400, Martin S. Weber wrote:
> Ok, I see ticket 425 open (for over a year now) for that case already.
> Questions remaining are, why doesn't the compiler (in general) output
> errors like these on stderr? And is there any hope of this being fixed
> somewhen soon? It makes swing'ing harder than it should be imo..

You cannot imagine the kind of time I've put into 425. It doesn't
output a better error message because it's a "this shouldn't happen!"
sort of error which represents an internal state which makes no sense.
The pattern matcher code is so opaque that david and I have basically
agreed the only way to fix some of the bugs is to rewrite it so we can
understand it. I'm positive I could now rewrite it in less time than
I've spent on the most confusing bugs, so there's that.

But right now I'm rewriting the parser. (Halfway there in one day, for
certain values of halfway...)

Martin S. Weber
Joined: 2008-12-23,
User offline. Last seen 42 years 45 weeks ago.
Re: Consistency Error triggered by...

Quoting Paul Phillips :

> On Wed, Mar 18, 2009 at 03:57:35PM -0400, Martin S. Weber wrote:
>> Ok, I see ticket 425 open (for over a year now) for that case already.
>> Questions remaining are, why doesn't the compiler (in general) output
>> errors like these on stderr? And is there any hope of this being fixed
>> somewhen soon? It makes swing'ing harder than it should be imo..
>
> You cannot imagine the kind of time I've put into 425. It doesn't
> output a better error message because it's a "this shouldn't happen!"
> sort of error which represents an internal state which makes no sense.

Not a problem. What I was referring to is that it obviously doesn't go
to stderr (filedes 2 under Unix) but instead elsewhere. With the whole
program being dumped, it's hard to scroll back to even see the message
when you don't have a thousand lines of scrollback in the terminal
you're compiling.
Could at least the error message be sent to stderr so people can
actually have point that filedes elsewhere than stdout?

> The pattern matcher code is so opaque that david and I have basically
> agreed the only way to fix some of the bugs is to rewrite it so we can
> understand it. I'm positive I could now rewrite it in less time than
> I've spent on the most confusing bugs, so there's that.
>
> But right now I'm rewriting the parser. (Halfway there in one day, for
> certain values of halfway...)

NP. What I find kind of funny is that it works (see my example) when
you don't try and bind to a value by the pattern matching. I'll just
be using that and keep val's of what I catch the events on in scope of
the event handler. So at least there's a workaround, which is fine for
me (now :). Good luck with really fixing/rewriting it!

Thanks,

-Martin

DRMacIver
Joined: 2008-09-02,
User offline. Last seen 42 years 45 weeks ago.
Re: Consistency Error triggered by...

2009/3/18 Martin S. Weber :
> the attached mini-program.
>
> tst-case.scala:20: error: consistency problem in target generation ! I have
> args List(temp7) and need to jump to a label with fmls List()
>
>
> Why? What can I do to avoid it? Why do I get a consistency error and not a

As with paulp, I've spent a fair bit of time trying to get to the
bottom of this bug (I have to admit he's probably spent more). So as
to "Why?", I'm as much in the dark as you are.

> normal compile error?

Despite the rather odd error message, it is actually being reported
just as a normal compile error. But...

> Why doesn't the consistency error output go to
> filedesc 2 (aka STDERR) so I can 2>&1 | less it? Should I create a ticket
> for that?

As far as I can tell, scalac doesn't use stderr for compile errors.
This could arguably be considered a bug, but isn't specific to this
problem. Feel free to file a ticket (though I can't promise it will
get fixed).

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland