Fix error when hoisting a non-ref call#80138
Conversation
| } | ||
| } | ||
| """; | ||
| CompileAndVerify(source, expectedOutput: "123123").VerifyDiagnostics(); |
There was a problem hiding this comment.
Please verify runtime async for this test as well, see examples in this file. You're going to conflict with #80093, and depending on who gets in first, one of us is going to need to adjust. I expect there to be an error for this test with runtime async right now; #79763 tracks this, please leave a comment here too.
Please consider moving this test to CodeGenAsyncSpillTests.cs, since that's where the rest of the spilling tests are.
|
|
||
| static async Task Test3<T>() where T : I1 | ||
| { | ||
| GetT<T>()[0] += await Get1Async(); |
There was a problem hiding this comment.
Consider strengthening the test and observing order of evaluation in this statement. For example, replacing 0 with a function call and printing something distinct from each function and the accessors involved. With the current output we cannot even tell accessors apart. #Closed
|
Done with review pass (commit 1) #Closed |
| await Test3<S1>(); | ||
| } | ||
|
|
||
| static T GetT<T>() where T : I1 => (T)(object)new S1 { F1 = 123 }; |
|
|
||
| var comp = CreateRuntimeAsyncCompilation(source); | ||
| comp.VerifyEmitDiagnostics( | ||
| // (38,31): error CS9328: Method 'Program.Test3<T>()' uses a feature that is not supported by runtime async currently. Opt the method out of runtime async by attributing it with 'System.Runtime.CompilerServices.RuntimeAsyncMethodGenerationAttribute(false)'. |
There was a problem hiding this comment.
Hoisting isn't supported, it's being added in #80093.
|
Done with review pass (commit 2) |
|
@333fred for another look, thanks |
* upstream/main: (233 commits) Extensions: add SyntaxGenerator support and AssociatedExtensionImplementation API (dotnet#80170) Fix error when hoisting a non-ref call (dotnet#80138) Ensure that refkinds are rewritten for complex methods (dotnet#79916) Revert Do not go through the workspace to access services DefiniteAssignmentPass.MarkFieldsUsed - avoid infinite recursion due to generic substitution (dotnet#80135) Reduce allocations in AnalyzerDriver.TryExecuteSymbolEndActions (dotnet#79855) RefSafetyAnalysis: Fix handling of nested deconstruction utilizing modern extensions (dotnet#80231) Extensions: adjust rewriting of anonymous type property symbols (dotnet#80211) Extensions: Move public APIs into INamedTypeSymbol (dotnet#80230) Extensions: improve error recovery in older language versions (dotnet#80206) Fall back to `dotnet exec` if apphost does not exist (dotnet#80153) Update dependencies from https://github.com/dotnet/dotnet build 282708 (dotnet#80228) Add a workaround for microsoft/vs-mef#620 Revert "FailFast if the MEF composition is clearly broken" switch from windows combobox to visualstudio combobox (dotnet#80219) Update System.Text.Json in packages which use 4.12 Roslyn (dotnet#80197) add flags to unblock CI (dotnet#80222) Move static members to another type - qualifies static member references in the moved members (dotnet#80178) Fix broken link for C# 14 lambda parameter modifiers ...
Fixes #79415.