[Issue 17559] [REG2.073.0] Wrong line number in stack trace

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Jun 27 00:32:05 PDT 2017


https://issues.dlang.org/show_bug.cgi?id=17559

--- Comment #4 from Rainer Schuetze <r.sagitario at gmx.de> ---
You get the same result without default parameters, too:

///////////// test.d /////////////
import mod;

void main()
{
    fun(1, 10);
    fun(2, 10);
    fun(3, 10);
    fun(4, 10);
}
////////////// mod.d /////////////
void fun(int n, int defParam)
{
    assert(n != 4);
}
//////////////////////////////////


The problem seems to be that the backend always performs common sub expression
elimination, mapping all instances of "10" to the same expression instance and
then emitting its location.

I suspect this exists since forever, but I haven't tried older versions yet.

--


More information about the Digitalmars-d-bugs mailing list