Allow using /main with top-level statements#79577
Merged
jjonescz merged 2 commits intodotnet:mainfrom Aug 11, 2025
Merged
Conversation
RikkiGibson
approved these changes
Jul 25, 2025
Member
RikkiGibson
left a comment
There was a problem hiding this comment.
the implementation itself LGTM. Still working on understanding the scenario.
jcouv
reviewed
Aug 6, 2025
|
|
||
| comp.VerifyEmitDiagnostics( | ||
| // error CS8804: Cannot specify /main if there is a compilation unit with top-level statements. | ||
| Diagnostic(ErrorCode.ERR_SimpleProgramDisallowsMainType).WithLocation(1, 1), |
Member
There was a problem hiding this comment.
Let's verify execution for scenarios that no longer error
333fred
added a commit
to 333fred/roslyn
that referenced
this pull request
Aug 13, 2025
* 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 ...
This was referenced Aug 19, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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