Bug 20579 – TypeInfo.opEquals is broken

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-02-13T14:34:36Z
Last change time
2021-08-01T12:53:28Z
Assigned to
No Owner
Creator
Richard Manthorpe

Comments

Comment #0 by rmanth — 2020-02-13T14:34:36Z
struct A(T) {} template B(T) { struct C {} } void main() { assert(typeid(A!(B!int.C)) != typeid(A!(B!string.C))); // assertion failure! } This fails on all platforms. The problem is the attempted fix for TypeInfo.opEquals for DLLs falls back to comparing non-unique strings like TypeInfo_Struct.name. This doesn't help anyway since casting is broken for Windows DLLs, so it just breaks things by creating false-positives in other cases.
Comment #1 by rmanth — 2020-02-13T14:52:39Z
Comment #2 by kinke — 2021-08-01T12:53:28Z
This was fixed by https://github.com/dlang/dmd/pull/12928, see issues 22149 and 22150.