Bug 5733 – Calling opDispatch As Template Results in Compiler Infinite Loop

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
Windows
Creation time
2011-03-13T21:51:00Z
Last change time
2012-03-15T15:41:45Z
Keywords
ice, pull
Assigned to
nobody
Creator
wfunction
See also
http://d.puremagic.com/issues/show_bug.cgi?id=7702

Comments

Comment #0 by wfunction — 2011-03-13T21:51:57Z
The code below causes the compiler to go into an infinite loop, continuously allocating memory until it crashes: struct Test { struct opDispatch(string dummy) { enum opDispatch = 1; } } auto temp = Test().foo!(int)(); Please *do* allow generics to work inside opDispatch (do not just remove the feature), as it allows for some very neat tricks (like static "late" binding) to be done.
Comment #1 by k.hara.pg — 2012-03-13T18:35:50Z
Comment #2 by github-bugzilla — 2012-03-15T15:05:20Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/380b2f8a26da0cb5c6a263608efb2c7020f25c7e Merge pull request #808 from 9rnsr/fix7702 Issue 7702 & 5733 - opDispatch goes into infinite loop