-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Allow using /main with top-level statements
#79577
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
Conversation
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.
the implementation itself LGTM. Still working on understanding the scenario.
|
|
||
| comp.VerifyEmitDiagnostics( | ||
| // error CS8804: Cannot specify /main if there is a compilation unit with top-level statements. | ||
| Diagnostic(ErrorCode.ERR_SimpleProgramDisallowsMainType).WithLocation(1, 1), |
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.
Let's verify execution for scenarios that no longer error
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.
LGTM Thanks (commit 1)
* upstream/main: (87 commits) Fix ref safety of implicit calls that might capture refs in the receiver (dotnet#76657) Update dependencies from https://github.com/dotnet/dotnet build 278961 Updated Dependencies: System.CommandLine (Version 2.0.0-rc.1.25410.101 -> 2.0.0-rc.1.25411.109) Update checklist for adding new language version (dotnet#79881) Skip ValidateAllOptions flaky test Don't try to load file based projects unless we get a .cs file (dotnet#79844) Update package restore error message. [main] Source code updates from dotnet/dotnet (dotnet#79862) Fix failure to report integration test results when retrying Also fix newly failing tests feedback More semantic update changes (dotnet#79828) Fix flow analysis of extern local functions (dotnet#79741) Allow using `/main` with top-level statements (dotnet#79577) Delete Async JTF.run Delete comment Delete code Cancel in flight work Simplify Fix race condition ...
Speclet update: dotnet/csharplang#9546
Resolves dotnet/csharplang#9544
LDM notes: https://github.com/dotnet/csharplang/blob/main/meetings/2025/LDM-2025-07-30.md#main-and-top-level-statements