Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix overzealous check for multiple main() functions #2778

Merged
merged 1 commit into from
Jul 19, 2018

Conversation

kinke
Copy link
Member

@kinke kinke commented Jul 16, 2018

No description provided.

@thewilsonator
Copy link
Contributor

Add a test case for this?

// in the glue code, so we need to do it here as well.
if (isMainFunction(fdecl) && fdecl->fbody) {
// Detect multiple main function definitions, which is disallowed.
// DMD checks this in the glue code, so we need to do it here as well.
if (gIR->mainFunc) {
error(fdecl->loc, "only one `main` function allowed");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"only one `main` function definition is allowed"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardly worth mentioning explicitly IMO, DMD doesn't either.

@kinke kinke merged commit 4d5871a into ldc-developers:master Jul 19, 2018
@kinke kinke deleted the fixMultiMain branch July 19, 2018 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants