List of DMD dependency issue (which would be sloved by a task based system)
Stefan Koch
uplink.coder at googlemail.com
Fri Dec 4 08:38:27 UTC 2020
On Friday, 4 December 2020 at 07:20:38 UTC, Mr T. wrote:
> Here's one *not* depending on declaration order, an ambiguity
> bug:
>
> ----------------------------------
> // main.d
> import ma;
> import mb;
> immutable X = Y; // no error!
> int main() {
> return 0;
> // return Y; // error: ma.Y conflicts with mb.Y
> }
> ----------------------------------
> module ma;
> enum Y = 48;
> ----------------------------------
> module mb;
> import main;
> //static if (true) // main.d: error on X: ma.Y conflicts
> with mb.Y
> static if (X == 48) // no error!
> enum Y = 64;
> ----------------------------------
SDC does detect the ambiguity.
uplink at uplink-black:~/ambig$ ../d/SDC/bin/sdc main.d
main.d:4:0: error: Already defined
int main() {
return 0;
// return
Even though the error message isn't great.
I should probably fix it ;)
More information about the Digitalmars-d
mailing list