Skip to content

Commit

Permalink
Add markdown feature documents
Browse files Browse the repository at this point in the history
  • Loading branch information
TyOverby committed Apr 14, 2017
1 parent a9059d6 commit 4d275dd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/features/async-main.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Async Task Main
## [dotnet/csharplang proposal](https://github.com/dotnet/csharplang/blob/master/proposals/async-main.md)

## Technical Details

* The compiler must recognize `Task` and `Task<int>` as valid entrypoint return types in addition to `void` and `int`.
* The compiler must allow `async` to be placed on a main method that returns a `Task` or a `Task<T>` (but not void).
* The compiler must generate a shim method `$EntrypointMain` that mimics the arguments of the user-defined main.
* `static async Task Main(...)` -> `static void $EntrypointMain(...)`
* `static async Task<int> Main(...)` -> `static int $EntrypointMain(...)`
* The parameters between the user-defined main and the generated main should match exactly.
* The body of the generated main should be `return Main(args...).GetAwaiter().GetResult();`
4 changes: 4 additions & 0 deletions docs/features/async-main.test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Main areas to test:
* Signature acceptance / rejection
* Method body creation
* Correct entrypoint assignment

0 comments on commit 4d275dd

Please sign in to comment.