Bug 343 – Compile error using mixin containing struct

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-09-11T00:14:00Z
Last change time
2014-02-15T13:18:57Z
Keywords
rejects-valid
Assigned to
bugzilla
Creator
sean

Comments

Comment #0 by sean — 2006-09-11T00:14:36Z
Compiling: struct S { void* function(void*) fn; } template M() { S s; } void main() { mixin M; } Gives: test.d(8): cannot implicitly convert expression (0) of type int to S test.d(8): cannot cast int to S test.d(8): cannot cast int to S However, compiling: struct S { void* function(void*) fn; } template M() { S s = void; } void main() { mixin M; } Works fine: C:\code\src\d\test>dmd test c:\bin\dmd\bin\..\..\dm\bin\link.exe test,,,user32+kernel32/noi; C:\code\src\d\test>
Comment #1 by thomas-dloop — 2006-09-13T17:40:34Z
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [email protected] schrieb am 2006-09-11: > http://d.puremagic.com/issues/show_bug.cgi?id=343 > Compiling: > > struct S > { > void* function(void*) fn; > } > > template M() > { > S s; > } > > void main() > { > mixin M; > } > > Gives: > > test.d(8): cannot implicitly convert expression (0) of type int to S > test.d(8): cannot cast int to S > test.d(8): cannot cast int to S <snip> Added to DStress as http://dstress.kuehne.cn/run/m/mixin_24_A.d http://dstress.kuehne.cn/run/m/mixin_24_B.d http://dstress.kuehne.cn/run/m/mixin_24_C.d http://dstress.kuehne.cn/run/m/mixin_24_D.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFFCIcILK5blCcjpWoRAosUAJ42rGe/PqM3TmJth0t+oau8WSiAsgCgib8K CPAnv5ixLRaOVs+oQ+5hBrc= =AOH5 -----END PGP SIGNATURE-----
Comment #2 by bugzilla — 2006-11-25T03:28:07Z
Fixed DMD 0.175