www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22149] New: TypeInfo_Struct names aren't unique, leading to

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

          Issue ID: 22149
           Summary: TypeInfo_Struct names aren't unique, leading to
                    botched equality semantics
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: kinke gmx.net

```
struct Foo(T) {}

void main()
{
    auto foo()
    {
        struct S {}
        return Foo!S();
    }

    auto bar()
    {
        struct S {}
        return Foo!S();
    }

    auto f = foo();
    auto b = bar();

    // both fail:
    assert(typeid(f) != typeid(b));
    assert(typeid(f).name != typeid(b).name);
}
```

[TypeInfo_Class names aren't unique either, will file an extra issue about
that.]

--
Jul 27