Bug 10 – Mixin variables not being properly initialized

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-03-04T20:50:00Z
Last change time
2014-02-14T20:33:35Z
Keywords
wrong-code
Assigned to
bugzilla
Creator
sean

Comments

Comment #0 by sean — 2006-03-04T20:50:28Z
Note that if I uncomment the printf line in main then the output is: 0 0 as it should be. C:\code\d\bugs>type 147_1.d import std.c.stdio; template mix() { int i; void print() { printf( "%i\n", i ); } } void main() { mixin mix!(); print(); //printf( "%i\n", i ); } C:\code\d\bugs>dmd 147_1.d C:\bin\dmd\bin\..\..\dm\bin\link.exe 147_1,,,user32+kernel32/noi; C:\code\d\bugs>147_1 4202539 C:\code\d\bugs> DStress test cases: http://dstress.kuehne.cn/run/m/mixin_17_A.d http://dstress.kuehne.cn/run/m/mixin_17_B.d http://dstress.kuehne.cn/run/m/mixin_17_C.d http://dstress.kuehne.cn/run/m/mixin_17_D.d http://dstress.kuehne.cn/run/m/mixin_17_E.d http://dstress.kuehne.cn/run/m/mixin_17_F.d
Comment #1 by bugzilla — 2006-04-28T02:53:48Z
Fixed 0.155