Add support for HandleAsyncEntryPoint API in async Main code generation#80939
Add support for HandleAsyncEntryPoint API in async Main code generation#80939
Conversation
…generation Co-authored-by: 333fred <2371880+333fred@users.noreply.github.com>
…ixes) Co-authored-by: 333fred <2371880+333fred@users.noreply.github.com>
Co-authored-by: 333fred <2371880+333fred@users.noreply.github.com>
src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedEntryPointSymbol.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedEntryPointSymbol.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncMainTests.cs
Outdated
Show resolved
Hide resolved
…back - Use Binder.TryGetSpecialTypeMember with isOptional: true - Simplify CreateBody by computing entry point call in constructor - Create minimal corelib tests that verify IL generation - All existing tests pass, 2 of 3 new tests pass Co-authored-by: 333fred <2371880+333fred@users.noreply.github.com>
src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncMainTests.cs
Outdated
Show resolved
Hide resolved
… tests - Created MinimalAsyncCorelibWithAsyncHelpers constant with both HandleAsyncEntryPoint methods - Updated all tests to use the shared corelib - Used MakeMemberMissing to test fallback scenarios instead of separate corelib - Added fallback tests for both Task and Task<int> - All 4 new tests pass, all 63 async Main tests pass Co-authored-by: 333fred <2371880+333fred@users.noreply.github.com>
|
@dotnet/roslyn-compiler for review |
|
@copilot you need to fix your formatting, check by running |
- Fixed whitespace formatting in CodeGenAsyncMainTests.cs - Added HandleAsyncEntryPoint members to C# AllSpecialTypeMembers test - Added HandleAsyncEntryPoint members to VB AllSpecialTypeMembers test - All tests pass Co-authored-by: 333fred <2371880+333fred@users.noreply.github.com>
Fixed in commit 98c7207:
|
|
@AlekseyTs @jjonescz for another look please |
src/Compilers/VisualBasic/Test/Symbol/SymbolsTests/WellKnownTypeValidationTests.vb
Outdated
Show resolved
Hide resolved
| System_Runtime_CompilerServices_AsyncHelpers__AwaitAwaiter_TAwaiter, | ||
| System_Runtime_CompilerServices_AsyncHelpers__UnsafeAwaitAwaiter_TAwaiter, | ||
| System_Runtime_CompilerServices_AsyncHelpers__HandleAsyncEntryPoint_Task, | ||
| System_Runtime_CompilerServices_AsyncHelpers__HandleAsyncEntryPoint_Task_Int32, |
There was a problem hiding this comment.
Question not related to this code location:
The "async Main" feature spec included details about codegen: https://github.com/dotnet/csharplang/blob/main/proposals/csharp-7.1/async-main.md
Do we need a corresponding spec change for this work? Should LDM be made aware?
There was a problem hiding this comment.
Well, the spec uses the works "equivalent of" for the codegen. These are the equivalent of that, so IMO that's enough weasel-wording for the implementation. I can send an email to LDM if you feel strongly though.
There was a problem hiding this comment.
I'd at least at link to the new design from the async-main spec
src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedEntryPointSymbol.cs
Show resolved
Hide resolved
src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncMainTests.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedEntryPointSymbol.cs
Outdated
Show resolved
Hide resolved
jcouv
left a comment
There was a problem hiding this comment.
Done with review pass (commit 11)
src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedEntryPointSymbol.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedEntryPointSymbol.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncMainTests.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncMainTests.cs
Outdated
Show resolved
Hide resolved
|
Done with review pass (commit 11) #Closed |
|
@AlekseyTs @jjonescz for another review please |
AlekseyTs
left a comment
There was a problem hiding this comment.
LGTM (commit 12), assuming CI is passing
Test Status:
Original prompt
Maincode generation #80873💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.