Fixes handling of methods Task.WaitAsync and SemaphoreSlim.WaitAsync#122
Conversation
…ed instead of just renaming the original method.
…d subsequently being dropped during rewriting
|
I assume the failed job is simply due to the fact that there is no package ready to be published, as I noticed the same error in other PRs, but do let me know if there's anything I'm supposed to fix. |
download-artifact@v5 no longer populates a per-name packages/ subdirectory from a nameless "download all" step, so the sign job's packages/ directory was empty and the packages-signed artifact was never uploaded, failing publish. Download the packages artifact explicitly into packages/. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fork PRs don't have access to the signing/publish secrets, so the sign and publish jobs can't do anything useful and the publish job fails when the (never-produced) packages-signed artifact can't be downloaded. Gate both jobs to run only on non-fork events (push, workflow_dispatch, and same-repo PRs), leaving build+test+pack to run for everyone. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Hi again, @michelebastione, Thanks for the contribution. |
|
Your changes are in 2.0.15 on nuget |
|
Thanks @virzak! We've been hard at work on MiniExcel, in the past year we fixed 100+ issues and added many new features, and your project definitely helped us navigate through it more swiftly. Now that we're almost ready to release the full fledged v2 I thought it could be a good moment to take a step back and give back a little, so here I am lol. |
Description
This PR addresses two closely related bugs that caused entire method bodies being inadvertently dropped at the invocation of
Task.WaitAsyncorSemaphoreSlim.WaitAsync.Both issues originated from a syntax check for the string "WaitAsync":
AsyncToSyncRewriter.ReplaceAsyncthe pattern matching for case MemberAccessExpressionSyntax lacked a fallback for validation purposes (when called fromEndWithAsync). Hence WaitAsync calls chained at the end of a method (e.g.,FooAsync().WaitAsync()) made the entire expression chain always return null, leading to them ultimately being discarded.ExpressionSyntaxvalue, there was no differentiation between Task methods, which are supposed to be dropped, and methods such asSemaphoreSlim.WaitAsync, which should be converted toSemaphoreSlim.Waitinstead. As a result, synchronization primitives were being deleted from the generated code.Changes Introduced
ReplaceAsyncandEndsWithAsync. The latter now implements a fallback to a non null value for the MemberAccessExpressionSyntax pattern matching case, thus preventing the entire chain call to be dropped.TryReplaceIdentifiermethod that uses the code block'sSemanticModelfor making sure that a symbol called "WaitAsync" is removed only when its containing type corresponds toSystem.Threading.Tasks.TaskorSystem.Threading.Tasks.TimeProviderTaskExtensions.fixes #119
fixes #121