Bug 6240 – ICE(toctype.c) [GSoC]: with template mixin

Status
RESOLVED
Resolution
WORKSFORME
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2011-07-02T06:11:00Z
Last change time
2013-10-05T16:39:28Z
Keywords
ice
Assigned to
nobody
Creator
cristi.cobzarenco

Comments

Comment #0 by cristi.cobzarenco — 2011-07-02T06:11:52Z
== File 1: imported.d == struct MixinAlias( T ) { private T m_; auto front() { return 1; } } mixin template Mixin( T ) { alias MixinAlias!(typeof(this)) LocalAlias; } struct Mixer( T ) { mixin Mixin!( T ); } == File 2: main.d == import imported; int main() { alias Mixer!int Failure; return 0; } Compiled with: dmd imported.d main.d Output: Assertion failure: 'next' on line 254 in file 'toctype.c' Platform: Windows 7 x86_64 DMD: 2.053 The following things fix the error: - Changing the order of the files. - Moving everything in one module. - Changing auto to int in the declaration of MixinAlias.front - Moving the alias from Mixin to Mixer. - Removing the member m_ from MixinAlias. This bug might not seem major, but it's very hard to avoid in the design I've chosen for my GSoC project.
Comment #1 by kennytm — 2011-07-02T13:04:48Z
Apparently fixed somewhere between DMD commits 0d93cf4333df6e167f9027eb1a4b0aa9a940ff19 and dbdbeb1ed9890e317c0fbb594dd331f18d025864. Anyway, I can't reproduce this in OS X with git master.
Comment #2 by lovelydear — 2012-04-20T15:03:51Z
Can't reproduce on 2.059 Win32 either.
Comment #3 by bugzilla — 2013-10-05T16:39:28Z
Works fine on 2.064 head.