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

Add main attributes proposal #5817

Closed
wants to merge 2 commits into from
Closed

Conversation

chsienki
Copy link
Contributor

No description provided.

Comment on lines +36 to +37
Only simple program entrypoints are supported. In the case of multiple
entrypoints the attribute will only apply to the first chosen location.
Copy link
Member

Choose a reason for hiding this comment

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

There are not multiple entry points for programs with top level statements.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There can be. Although its an error case, the compiler explicitly allows you to have multiple files with top level statements. We're saying here that we'll only apply the attributes to the first one (same as if you call getEntryPoint and there are multiple ones).

Copy link
Member

Choose a reason for hiding this comment

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

Although its an error case, the compiler explicitly allows you to have multiple files with top level statements

It's an error case. The compiler explicitly does not allow it. Therefore, our handling of such an error case is an implementation detail, and doesn't belong in the specification.

Copy link
Member

Choose a reason for hiding this comment

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

I think we could simplify this to essentially

Only simple program entrypoints are supported. It is not supported when there is an explicit Main method which qualifies as the entry point.

I agree we should avoid listing out how it works in cases like multiple files with top level statements. That is already an error scenario, basically an invalid program. Generally we don't spec out behaviors for scenarios like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants