D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 5733 - Calling opDispatch As Template Results in Compiler Infinite Loop
Summary: Calling opDispatch As Template Results in Compiler Infinite Loop
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: ice, pull
Depends on:
Blocks:
 
Reported: 2011-03-13 21:51 UTC by dlang+issues
Modified: 2012-03-15 15:41 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description dlang+issues 2011-03-13 21:51:57 UTC
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 2 github-bugzilla 2012-03-15 15:05:20 UTC
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