[Issue 23495] New: Can't use 2 aliases to members of different struct/classes (Template instance is nested in both `A` and `B`)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Nov 19 10:39:05 UTC 2022


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

          Issue ID: 23495
           Summary: Can't use 2 aliases to members of different
                    struct/classes (Template instance is nested in both
                    `A` and `B`)
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: msnmancini at hotmail.com

This error was found by Vabenil on Discord.

Error: template instance `AliasSeq!(foo, bar)` `AliasSeq!(foo, bar)` is nested
in both `A` and `B`


Test code: 
```d
import std.meta;
import std.stdio;

struct A {
    int foo;
}

struct B {
    int bar;
}

int main()
{
    writeln(AliasSeq!(A.foo, B.bar).stringof);
    return 0;
}
```

--


More information about the Digitalmars-d-bugs mailing list