-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Conversation
Only simple program entrypoints are supported. In the case of multiple | ||
entrypoints the attribute will only apply to the first chosen location. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
No description provided.