List of DMD dependency issue (which would be sloved by a task based system)

Stefan Koch uplink.coder at googlemail.com
Mon Nov 30 10:22:16 UTC 2020


On Sunday, 22 November 2020 at 15:08:30 UTC, Dennis wrote:
> On Sunday, 22 November 2020 at 13:57:39 UTC, Stefan Koch wrote:
>> I'd like to have a list of dependency issues that dmd has 
>> which are caused by the ad-hoc dependency system used for 
>> semantic dependencies in dmd.
>
> Here's one:
>
> ```
> immutable int a = b;
> mixin("immutable int b = 3;");
> ```
>
> https://issues.dlang.org/show_bug.cgi?id=9125

Thanks for this example.

I crafted a slightly more complicated version

---
import core.stdc.stdio;

struct Foo { t x; }
mixin("static if (true) { alias t = type; }");
mixin("alias type = short;");
void main()
{
     printf("%d == 2\n".ptr, Foo.init.x.sizeof);
}

---

DMD will fail on this.
Whereas SDC (https://github.com/sdc-developers/SDC) does compile 
it and outputs the string `2 == 2`

it should be noted that SDC currently fails at the even more 
complicated:

---
import core.stdc.stdio;

struct Foo { t x; }
static immutable TRUE = mixin("true");
static if (TRUE)
     mixin("alias type = short;");
mixin("static if (true) { alias t = type; }");

void main()
{
     printf("%d == 2\n".ptr, Foo.init.x.sizeof);
}
---


More information about the Digitalmars-d mailing list