D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7959 - dmd compiler crashes with internal error when main() redefined
Summary: dmd compiler crashes with internal error when main() redefined
Status: RESOLVED DUPLICATE of issue 5634
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-20 23:41 UTC by thelastmammoth
Modified: 2012-04-21 03:05 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description thelastmammoth 2012-04-20 23:41:46 UTC
>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 Dmitry Olshansky 2012-04-21 03:05:35 UTC

*** This issue has been marked as a duplicate of issue 5634 ***