Bug 7959 – dmd compiler crashes with internal error when main() redefined
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-04-20T23:41:00Z
Last change time
2012-04-21T03:05:35Z
Assigned to
nobody
Creator
thelastmammoth
Comments
Comment #0 by thelastmammoth — 2012-04-20T23:41:46Z
>cat fun.d
module fun;
void main(){}
>cat main.d
module main;
import fun;
void main(){}
>rdmd main
Internal error: ../ztc/machobj.c 2149
//instead of gracefully giving an error that main shouldn't be defined elsewhere
This is specific to main, as the following compiles fine:
>cat fun.d
module fun;
void fun(){}
>cat main.d
module main;
import fun;
void fun(){}
void main(){}
Comment #1 by dmitry.olsh — 2012-04-21T03:05:35Z
*** This issue has been marked as a duplicate of issue 5634 ***