Skip to content

Fix ManualResetValueTaskSourceCore polyfill missing on netstandard2.0#115

Merged
Tyrrrz merged 6 commits intoprimefrom
copilot/investigate-issue-185
Apr 17, 2026
Merged

Fix ManualResetValueTaskSourceCore polyfill missing on netstandard2.0#115
Tyrrrz merged 6 commits intoprimefrom
copilot/investigate-issue-185

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 17, 2026

ManualResetValueTaskSourceCore<T> is not present in the netstandard2.0 DLL of System.Threading.Tasks.Extensions — only IValueTaskSource<T>, ValueTaskSourceStatus, and ValueTaskSourceOnCompletedFlags are. The type exists natively only in .NET Core 2.1+ / .NET Standard 2.1+. When System.Threading.Tasks.Extensions was transitively referenced (e.g. via Microsoft.CodeAnalysis.CSharp), PolyShim incorrectly suppressed its own ManualResetValueTaskSourceCore<T> polyfill, causing a missing-type build failure in consumers.

Changes

  • PolyShim/PolyShim.targets: Removed the FEATURE_VALUETASK_SOURCES_MANUALRESET flag entirely — since availability is purely TFM-based (no package reference check involved), there is no need for a build flag.
  • PolyShim/NetCore21/ManualResetValueTaskSourceCore.cs: Replaced the removed feature flag guard with an inline TFM check following the same pattern as other polyfill files: #if (NETCOREAPP && !NETCOREAPP2_1_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD && !NETSTANDARD2_1_OR_GREATER), with a nested #if FEATURE_TASK guard to exclude older .NET Framework targets (e.g. net35) where Task is not available. An inline comment explains that the compatibility package does not provide this type for netstandard2.0 or .NET Framework targets. The now-unreachable inner #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_0_OR_GREATER branch inside OnCompleted was also removed.

…dard2.0 with Extensions package

Agent-Logs-Url: https://github.com/Tyrrrz/PolyShim/sessions/b900dff5-29a3-4bbf-8cde-e7af84a51fcb

Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
@Tyrrrz Tyrrrz added the bug Something isn't working label Apr 17, 2026
@Tyrrrz Tyrrrz marked this pull request as ready for review April 17, 2026 09:03
Copilot AI review requested due to automatic review settings April 17, 2026 09:03
Comment thread PolyShim/PolyShim.targets Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes PolyShim’s feature detection so FEATURE_VALUETASK_SOURCES_MANUALRESET is not enabled for netstandard2.0 just because System.Threading.Tasks.Extensions is referenced, preventing missing-type build failures when the polyfill is incorrectly suppressed.

Changes:

  • Tighten FeatureValueTaskSourcesManualReset conditions to only enable on native availability (netcoreapp/netstandard ≥ 2.1) and update the explanatory comment.
  • Regenerate/update Signatures.md to reflect additional detected polyfills/signatures (counts and new entries).

Reviewed changes

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

File Description
Signatures.md Updates the generated signature inventory (counts + new entries).
PolyShim/PolyShim.targets Adjusts the MSBuild feature-flag logic so ManualResetValueTaskSourceCore<T> isn’t assumed present on netstandard2.0 via System.Threading.Tasks.Extensions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…URE flag from targets

Agent-Logs-Url: https://github.com/Tyrrrz/PolyShim/sessions/ef87e581-44e0-4187-a9c5-80c5fe71096f

Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Comment thread PolyShim/NetCore21/ManualResetValueTaskSourceCore.cs Outdated
Copilot AI changed the title Fix FEATURE_VALUETASK_SOURCES_MANUALRESET incorrectly enabled on netstandard2.0 Fix ManualResetValueTaskSourceCore polyfill missing on netstandard2.0 Apr 17, 2026
Copilot AI requested a review from Tyrrrz April 17, 2026 09:09
…er feedback

Agent-Logs-Url: https://github.com/Tyrrrz/PolyShim/sessions/45d3fa69-f2f8-4bdd-86eb-5cabd88d5ec0

Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.69%. Comparing base (b55d189) to head (69fe551).
⚠️ Report is 1 commits behind head on prime.

Additional details and impacted files
@@            Coverage Diff             @@
##            prime     #115      +/-   ##
==========================================
+ Coverage   90.66%   90.69%   +0.02%     
==========================================
  Files         282      282              
  Lines        4898     4898              
  Branches      401      401              
==========================================
+ Hits         4441     4442       +1     
+ Misses        367      366       -1     
  Partials       90       90              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Tyrrrz Tyrrrz merged commit f88b2d2 into prime Apr 17, 2026
7 checks passed
@Tyrrrz Tyrrrz deleted the copilot/investigate-issue-185 branch April 17, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants