Bug 15879 – Compiler crashes when two template structs have the same name

Status
RESOLVED
Resolution
DUPLICATE
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2016-04-05T19:13:00Z
Last change time
2016-04-05T20:05:38Z
Assigned to
nobody
Creator
andy.pj.hanson

Comments

Comment #0 by andy.pj.hanson — 2016-04-05T19:13:55Z
The crash happens when an imported template struct has the same name as one in the current module. It takes to modules to reproduce: app.d: import otheroption : Option; void main() { opt(1); } struct Option(T) {} Option!T opt(T)(T value) { return Option(); } otheroption.d: struct Option(T) if(is(T == class)) {} With these two files in the same directory, `dmd app.d` segfaults. The error goes away if `if(is(T == class))` is removed in `otheroption.d`.
Comment #1 by ag0aep6g — 2016-04-05T20:05:38Z
Duplicate of issue 15788. Already fixed in git master and the 2.071 beta. *** This issue has been marked as a duplicate of issue 15788 ***