Skip to content

Conversation

@Tyrrrz
Copy link
Owner

@Tyrrrz Tyrrrz commented Dec 3, 2025

No description provided.

Copilot AI review requested due to automatic review settings December 3, 2025 16:53
@Tyrrrz Tyrrrz added the enhancement New feature or request label Dec 3, 2025
Copy link
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

This PR adds polyfills for the DisposeAsync() method to Stream, TextReader, and TextWriter classes, enabling asynchronous disposal for platforms that don't natively support these methods (pre-.NET Core 3.0). The implementations check for native IAsyncDisposable support when available and fall back to wrapping synchronous Dispose() calls in Task.Run().

Key changes:

  • Added DisposeAsync() polyfill implementations for Stream, TextReader, and TextWriter classes
  • Updated documentation to reflect the addition of 4 new member signatures (3 DisposeAsync methods + Task.Yield)
  • Applied appropriate conditional compilation directives to target platforms lacking native support

Reviewed changes

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

File Description
PolyShim/Signatures.md Updated signature counts and added documentation entries for new DisposeAsync() methods and Task.Yield()
PolyShim/NetCore30/Stream.cs Implemented DisposeAsync() polyfill for Stream with fallback logic
PolyShim/NetCore30/TextReader.cs Implemented DisposeAsync() polyfill for TextReader with fallback logic
PolyShim/NetCore30/TextWriter.cs Implemented DisposeAsync() polyfill for TextWriter with fallback logic

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

@Tyrrrz Tyrrrz changed the title Add polyfills for Stream.DiposeAsync(), TextReader.DisposeAsync(...), TextWriter.DisposeAsync(...) Add polyfills for Stream.DisposeAsync(), TextReader.DisposeAsync(...), TextWriter.DisposeAsync(...) Dec 3, 2025
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.

2 participants