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>