Skip to content

Commit d563e5c

Browse files
authored
Allow using /main with top-level statements (#9546)
1 parent 83e6778 commit d563e5c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

proposals/csharp-9.0/top-level-statements.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ source code.
8888

8989
The method is designated as the entry point of the program. Explicitly declared methods that by convention
9090
could be considered as an entry point candidates are ignored. A warning is reported when that happens. It is
91-
an error to specify `-main:<type>` compiler switch when there are top-level statements.
91+
possible to specify a different entry point via the `-main:<type>` compiler switch.
9292

9393
The entry point method always has one formal parameter, `string[] args`. The execution environment creates and passes a `string[]` argument containing the command-line arguments that were specified when the application was started. The `string[]` argument is never null, but it may have a length of zero if no command-line arguments were specified. The ‘args’ parameter is in scope within top-level statements and is not in scope outside of them. Regular name conflict/shadowing rules apply.
9494

0 commit comments

Comments
 (0)