Bug 13587 – Symbols In Template Mixin Conflict Across Modules

Status
RESOLVED
Resolution
WORKSFORME
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2014-10-08T11:55:52Z
Last change time
2023-03-29T12:48:30Z
Assigned to
No Owner
Creator
Alice

Comments

Comment #0 by a.blunt — 2014-10-08T11:55:52Z
Referencing symbols defined in a template mixin causes a "conflict" error (see below) when mixin is used in several modules: // ModuleA.d module ModuleA; import ModuleB; mixin MixinUsefulStuff; pragma(msg, "a = ", SomeData.a); // Error: ModuleB.MixinUsefulStuff!().SomeData at ModuleB.d(5) conflicts with ModuleA.MixinUsefulStuff!().SomeData at ModuleB.d(5) // ModuleB.d module ModuleB; mixin template MixinUsefulStuff() { struct SomeData { enum a = 123; } } mixin MixinUsefulStuff;
Comment #1 by nicolas.jinchereau — 2014-11-30T19:13:16Z
Comment #2 by razvan.nitu1305 — 2023-03-29T12:48:30Z
I cannot reproduce this. I get: a = 123 when I compile the code. Seems to have been fixed.