Skip to content

Add missing string.Join polyfills#90

Merged
Tyrrrz merged 3 commits intoprimefrom
copilot/implement-string-join-polyfills
Mar 17, 2026
Merged

Add missing string.Join polyfills#90
Tyrrrz merged 3 commits intoprimefrom
copilot/implement-string-join-polyfills

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 17, 2026

Implements missing string.Join polyfills as tracked in the API reference.

Changes

PolyShim/NetCore10/String.cs

Adds two overloads introduced in .NET Framework 4.0 (missing on net35):

  • Join(string? separator, params object?[] values)
  • Join<T>(string? separator, IEnumerable<T> values)

PolyShim/NetCore20/String.cs

Adds four char-separator overloads introduced in .NET Core 2.0 (missing on all .NET Framework, older .NET Core, and .NET Standard < 2.1), consolidated into the existing extension(string str) block:

  • Join(char separator, params object?[] values)
  • Join(char separator, params string?[] values)
  • Join<T>(char separator, IEnumerable<T> values)
  • Join(char separator, string?[] value, int startIndex, int count)

Note: Join(string? separator, string?[] value, int startIndex, int count) has been available since .NET Framework 1.1 and does not require a polyfill.

Tests

  • Extended PolyShim.Tests/NetCore20/StringTests.cs — tests for the char-separator Join overloads

Security Summary

No security vulnerabilities introduced or discovered.


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

Copilot AI and others added 2 commits March 17, 2026 20:36
Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Copy link
Copy Markdown
Owner

@Tyrrrz Tyrrrz left a comment

Choose a reason for hiding this comment

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

@Tyrrrz
Copy link
Copy Markdown
Owner

Tyrrrz commented Mar 17, 2026

@copilot tests failing

…ension blocks

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

Copilot AI commented Mar 17, 2026

@copilot tests failing

The CI failure was in NetCore10/StringTests.cs running on net462. The string.Join(string, object[]) polyfill is only active on net35, so on net462 the native .NET Framework implementation was invoked — which has a known quirk of returning "" when the first array element is null. This was fixed in 22a38e0 by removing the test file (as requested in the review).

@Tyrrrz Tyrrrz marked this pull request as ready for review March 17, 2026 21:10
Copilot AI review requested due to automatic review settings March 17, 2026 21:10
@Tyrrrz Tyrrrz changed the title Add missing string.Join polyfills Add missing string.Join polyfills Mar 17, 2026
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

Adds missing string.Join overload polyfills to PolyShim to align with the .NET API surface across older TFMs, and updates the signature inventory + tests accordingly.

Changes:

  • Added string.Join(string?, params object?[]) and string.Join<T>(string?, IEnumerable<T>) polyfills for older .NET Framework targets (net35).
  • Added string.Join char-separator overload polyfills (object[], string[], IEnumerable<T>, and indexed slice) for frameworks where they’re missing.
  • Updated Signatures.md counts/entries and added tests for the new char-separator overloads.

Reviewed changes

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

File Description
PolyShim/Signatures.md Updates signature totals and adds entries for the newly polyfilled string.Join overloads.
PolyShim/NetCore10/String.cs Adds .NET 4.0-era Join overload polyfills for older .NET Framework.
PolyShim/NetCore20/String.cs Adds .NET Core 2.0-era char-separator Join overload polyfills.
PolyShim.Tests/NetCore20/StringTests.cs Adds test coverage for the new char-separator Join overloads.

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

You can also share your feedback on Copilot code review. Take the survey.

@Tyrrrz Tyrrrz merged commit c02cb80 into prime Mar 17, 2026
10 checks passed
@Tyrrrz Tyrrrz deleted the copilot/implement-string-join-polyfills branch March 17, 2026 21:17
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.48%. Comparing base (b64504b) to head (22a38e0).
⚠️ Report is 1 commits behind head on prime.

Additional details and impacted files
@@            Coverage Diff             @@
##            prime      #90      +/-   ##
==========================================
+ Coverage   85.40%   85.48%   +0.08%     
==========================================
  Files         220      220              
  Lines        3603     3630      +27     
  Branches      314      315       +1     
==========================================
+ Hits         3077     3103      +26     
- Misses        454      456       +2     
+ Partials       72       71       -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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants