Skip to content

Fix README compatibility packages example to use Microsoft.Bcl.Async on net40#116

Merged
Tyrrrz merged 1 commit intoprimefrom
copilot/update-readme-polyfill-example
Apr 17, 2026
Merged

Fix README compatibility packages example to use Microsoft.Bcl.Async on net40#116
Tyrrrz merged 1 commit intoprimefrom
copilot/update-readme-polyfill-example

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 17, 2026

The Microsoft.Bcl.AsyncInterfaces example was misleading: PolyShim doesn't polyfill IAsyncEnumerable<T> when that package is present (the package provides it directly), so no additional PolyShim polyfills were actually being enabled.

Changes

  • Replaces the netstandard2.0 + Microsoft.Bcl.AsyncInterfaces / Task.WhenEach example with a net40 + Microsoft.Bcl.Async example
  • Microsoft.Bcl.Async sets FEATURE_TASK=true, which unlocks PolyShim's ValueTask (FEATURE_TASK && !FEATURE_VALUETASK) and IAsyncEnumerable<T> (FEATURE_TASK && !FEATURE_ASYNCINTERFACES) polyfills — a genuine case of a compatibility package expanding PolyShim's coverage
// Microsoft.Bcl.Async is referenced, so these polyfills are enabled
static async ValueTask<int> SumAsync(IAsyncEnumerable<int> source)
{
    var sum = 0;
    await foreach (var value in source)
        sum += value;

    return sum;
}

…Async/net40 example

Agent-Logs-Url: https://github.com/Tyrrrz/PolyShim/sessions/51487cd5-005f-4617-a680-3417049f66f6

Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
@Tyrrrz Tyrrrz added bug Something isn't working documentation Improvements or additions to documentation labels Apr 17, 2026
@Tyrrrz Tyrrrz marked this pull request as ready for review April 17, 2026 09:26
Copilot AI review requested due to automatic review settings April 17, 2026 09:26
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

Updates the documentation example for compatibility packages to demonstrate a real case where adding a Microsoft compatibility package expands PolyShim’s available polyfills (instead of disabling them due to already-provided APIs).

Changes:

  • Replaces the netstandard2.0 + Microsoft.Bcl.AsyncInterfaces example with a net40 + Microsoft.Bcl.Async example.
  • Updates the sample code to show ValueTask + IAsyncEnumerable<T> usage enabled via Microsoft.Bcl.Async (i.e., FEATURE_TASK becomes available on net40).

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

@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.75%. Comparing base (b55d189) to head (7d0443c).
⚠️ Report is 2 commits behind head on prime.

Additional details and impacted files
@@            Coverage Diff             @@
##            prime     #116      +/-   ##
==========================================
+ Coverage   90.66%   90.75%   +0.08%     
==========================================
  Files         282      282              
  Lines        4898     4898              
  Branches      401      401              
==========================================
+ Hits         4441     4445       +4     
+ Misses        367      364       -3     
+ Partials       90       89       -1     

☔ 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 651ab4d into prime Apr 17, 2026
11 checks passed
@Tyrrrz Tyrrrz deleted the copilot/update-readme-polyfill-example branch April 17, 2026 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants