Skip to content

Commit

Permalink
fix TextWriter not exposing Write
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Feb 10, 2024
1 parent 8997c5a commit f102d34
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
9 changes: 7 additions & 2 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ Example:
#pragma warning disable

#if TASKSEXTENSIONSREFERENCED && MEMORYREFERENCED && (NETFRAMEWORK || NETSTANDARD2_0 || NETCOREAPP2_0)
#if MEMORYREFERENCED && (NETFRAMEWORK || NETSTANDARD2_0 || NETCOREAPP2_0)

using System;
using System.Buffers;
Expand All @@ -204,6 +204,9 @@ using System.Threading.Tasks;

static partial class Polyfill
{

#if TASKSEXTENSIONSREFERENCED

/// <summary>
/// Asynchronously writes a character memory region to the stream.
/// </summary>
Expand Down Expand Up @@ -256,6 +259,8 @@ static partial class Polyfill
return new(target.WriteLineAsync(segment.Array!, segment.Offset, segment.Count));
}

#endif

/// <summary>
/// Writes a character span to the text stream.
/// </summary>
Expand Down Expand Up @@ -304,7 +309,7 @@ static partial class Polyfill
}
#endif
```
<sup><a href='/src/Polyfill/Polyfill_TextWriter.cs#L1-L115' title='Snippet source file'>snippet source</a> | <a href='#snippet-Polyfill_TextWriter.cs' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Polyfill/Polyfill_TextWriter.cs#L1-L120' title='Snippet source file'>snippet source</a> | <a href='#snippet-Polyfill_TextWriter.cs' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand Down
7 changes: 6 additions & 1 deletion src/Polyfill/Polyfill_TextWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#pragma warning disable

#if TASKSEXTENSIONSREFERENCED && MEMORYREFERENCED && (NETFRAMEWORK || NETSTANDARD2_0 || NETCOREAPP2_0)
#if MEMORYREFERENCED && (NETFRAMEWORK || NETSTANDARD2_0 || NETCOREAPP2_0)

using System;
using System.Buffers;
Expand All @@ -14,6 +14,9 @@

static partial class Polyfill
{

#if TASKSEXTENSIONSREFERENCED

/// <summary>
/// Asynchronously writes a character memory region to the stream.
/// </summary>
Expand Down Expand Up @@ -66,6 +69,8 @@ public static ValueTask WriteLineAsync(
return new(target.WriteLineAsync(segment.Array!, segment.Offset, segment.Count));
}

#endif

/// <summary>
/// Writes a character span to the text stream.
/// </summary>
Expand Down

0 comments on commit f102d34

Please sign in to comment.