Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apiCount.include.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@
| `net8.0` | 400 |
| `net9.0` | 253 |
| `net10.0` | 190 |
| `net11.0` | 58 |
| `net11.0` | 57 |
| `uap10.0` | 1071 |
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The package targets `netstandard2.0` and is designed to support the following ru
| `net8.0` | 400 |
| `net9.0` | 253 |
| `net10.0` | 190 |
| `net11.0` | 58 |
| `net11.0` | 57 |
| `uap10.0` | 1071 |
<!-- endInclude -->

Expand Down
2 changes: 1 addition & 1 deletion src/Polyfill/StringBuilderPolyfill.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !NET12_0_OR_GREATER
#if !NET11_0_OR_GREATER

namespace Polyfills;

Expand Down
2 changes: 0 additions & 2 deletions src/Split/net10.0/StringBuilderPolyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// <auto-generated />
#pragma warning disable
#if !NET12_0_OR_GREATER
namespace Polyfills;
using System;
using System.Reflection;
Expand Down Expand Up @@ -51,4 +50,3 @@ static FieldInfo GetField(string name) =>
throw new($"Expected to find field '{name}' on StringBuilder");
}
}
#endif
54 changes: 0 additions & 54 deletions src/Split/net11.0/StringBuilderPolyfill.cs

This file was deleted.

2 changes: 0 additions & 2 deletions src/Split/net461/StringBuilderPolyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// <auto-generated />
#pragma warning disable
#if !NET12_0_OR_GREATER
namespace Polyfills;
using System;
using System.Reflection;
Expand Down Expand Up @@ -51,4 +50,3 @@ static FieldInfo GetField(string name) =>
throw new($"Expected to find field '{name}' on StringBuilder");
}
}
#endif
2 changes: 0 additions & 2 deletions src/Split/net462/StringBuilderPolyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// <auto-generated />
#pragma warning disable
#if !NET12_0_OR_GREATER
namespace Polyfills;
using System;
using System.Reflection;
Expand Down Expand Up @@ -51,4 +50,3 @@ static FieldInfo GetField(string name) =>
throw new($"Expected to find field '{name}' on StringBuilder");
}
}
#endif
2 changes: 0 additions & 2 deletions src/Split/net47/StringBuilderPolyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// <auto-generated />
#pragma warning disable
#if !NET12_0_OR_GREATER
namespace Polyfills;
using System;
using System.Reflection;
Expand Down Expand Up @@ -51,4 +50,3 @@ static FieldInfo GetField(string name) =>
throw new($"Expected to find field '{name}' on StringBuilder");
}
}
#endif
2 changes: 0 additions & 2 deletions src/Split/net471/StringBuilderPolyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// <auto-generated />
#pragma warning disable
#if !NET12_0_OR_GREATER
namespace Polyfills;
using System;
using System.Reflection;
Expand Down Expand Up @@ -51,4 +50,3 @@ static FieldInfo GetField(string name) =>
throw new($"Expected to find field '{name}' on StringBuilder");
}
}
#endif
2 changes: 0 additions & 2 deletions src/Split/net472/StringBuilderPolyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// <auto-generated />
#pragma warning disable
#if !NET12_0_OR_GREATER
namespace Polyfills;
using System;
using System.Reflection;
Expand Down Expand Up @@ -51,4 +50,3 @@ static FieldInfo GetField(string name) =>
throw new($"Expected to find field '{name}' on StringBuilder");
}
}
#endif
2 changes: 0 additions & 2 deletions src/Split/net48/StringBuilderPolyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// <auto-generated />
#pragma warning disable
#if !NET12_0_OR_GREATER
namespace Polyfills;
using System;
using System.Reflection;
Expand Down Expand Up @@ -51,4 +50,3 @@ static FieldInfo GetField(string name) =>
throw new($"Expected to find field '{name}' on StringBuilder");
}
}
#endif
2 changes: 0 additions & 2 deletions src/Split/net481/StringBuilderPolyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// <auto-generated />
#pragma warning disable
#if !NET12_0_OR_GREATER
namespace Polyfills;
using System;
using System.Reflection;
Expand Down Expand Up @@ -51,4 +50,3 @@ static FieldInfo GetField(string name) =>
throw new($"Expected to find field '{name}' on StringBuilder");
}
}
#endif
2 changes: 0 additions & 2 deletions src/Split/net5.0/StringBuilderPolyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// <auto-generated />
#pragma warning disable
#if !NET12_0_OR_GREATER
namespace Polyfills;
using System;
using System.Reflection;
Expand Down Expand Up @@ -51,4 +50,3 @@ static FieldInfo GetField(string name) =>
throw new($"Expected to find field '{name}' on StringBuilder");
}
}
#endif
2 changes: 0 additions & 2 deletions src/Split/net6.0/StringBuilderPolyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// <auto-generated />
#pragma warning disable
#if !NET12_0_OR_GREATER
namespace Polyfills;
using System;
using System.Reflection;
Expand Down Expand Up @@ -51,4 +50,3 @@ static FieldInfo GetField(string name) =>
throw new($"Expected to find field '{name}' on StringBuilder");
}
}
#endif
2 changes: 0 additions & 2 deletions src/Split/net7.0/StringBuilderPolyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// <auto-generated />
#pragma warning disable
#if !NET12_0_OR_GREATER
namespace Polyfills;
using System;
using System.Reflection;
Expand Down Expand Up @@ -51,4 +50,3 @@ static FieldInfo GetField(string name) =>
throw new($"Expected to find field '{name}' on StringBuilder");
}
}
#endif
2 changes: 0 additions & 2 deletions src/Split/net8.0/StringBuilderPolyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// <auto-generated />
#pragma warning disable
#if !NET12_0_OR_GREATER
namespace Polyfills;
using System;
using System.Reflection;
Expand Down Expand Up @@ -51,4 +50,3 @@ static FieldInfo GetField(string name) =>
throw new($"Expected to find field '{name}' on StringBuilder");
}
}
#endif
2 changes: 0 additions & 2 deletions src/Split/net9.0/StringBuilderPolyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// <auto-generated />
#pragma warning disable
#if !NET12_0_OR_GREATER
namespace Polyfills;
using System;
using System.Reflection;
Expand Down Expand Up @@ -51,4 +50,3 @@ static FieldInfo GetField(string name) =>
throw new($"Expected to find field '{name}' on StringBuilder");
}
}
#endif
2 changes: 0 additions & 2 deletions src/Split/netcoreapp2.0/StringBuilderPolyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// <auto-generated />
#pragma warning disable
#if !NET12_0_OR_GREATER
namespace Polyfills;
using System;
using System.Reflection;
Expand Down Expand Up @@ -51,4 +50,3 @@ static FieldInfo GetField(string name) =>
throw new($"Expected to find field '{name}' on StringBuilder");
}
}
#endif
2 changes: 0 additions & 2 deletions src/Split/netcoreapp2.1/StringBuilderPolyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// <auto-generated />
#pragma warning disable
#if !NET12_0_OR_GREATER
namespace Polyfills;
using System;
using System.Reflection;
Expand Down Expand Up @@ -51,4 +50,3 @@ static FieldInfo GetField(string name) =>
throw new($"Expected to find field '{name}' on StringBuilder");
}
}
#endif
2 changes: 0 additions & 2 deletions src/Split/netcoreapp2.2/StringBuilderPolyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// <auto-generated />
#pragma warning disable
#if !NET12_0_OR_GREATER
namespace Polyfills;
using System;
using System.Reflection;
Expand Down Expand Up @@ -51,4 +50,3 @@ static FieldInfo GetField(string name) =>
throw new($"Expected to find field '{name}' on StringBuilder");
}
}
#endif
2 changes: 0 additions & 2 deletions src/Split/netcoreapp3.0/StringBuilderPolyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// <auto-generated />
#pragma warning disable
#if !NET12_0_OR_GREATER
namespace Polyfills;
using System;
using System.Reflection;
Expand Down Expand Up @@ -51,4 +50,3 @@ static FieldInfo GetField(string name) =>
throw new($"Expected to find field '{name}' on StringBuilder");
}
}
#endif
2 changes: 0 additions & 2 deletions src/Split/netcoreapp3.1/StringBuilderPolyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// <auto-generated />
#pragma warning disable
#if !NET12_0_OR_GREATER
namespace Polyfills;
using System;
using System.Reflection;
Expand Down Expand Up @@ -51,4 +50,3 @@ static FieldInfo GetField(string name) =>
throw new($"Expected to find field '{name}' on StringBuilder");
}
}
#endif
2 changes: 0 additions & 2 deletions src/Split/netstandard2.0/StringBuilderPolyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// <auto-generated />
#pragma warning disable
#if !NET12_0_OR_GREATER
namespace Polyfills;
using System;
using System.Reflection;
Expand Down Expand Up @@ -51,4 +50,3 @@ static FieldInfo GetField(string name) =>
throw new($"Expected to find field '{name}' on StringBuilder");
}
}
#endif
2 changes: 0 additions & 2 deletions src/Split/netstandard2.1/StringBuilderPolyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// <auto-generated />
#pragma warning disable
#if !NET12_0_OR_GREATER
namespace Polyfills;
using System;
using System.Reflection;
Expand Down Expand Up @@ -51,4 +50,3 @@ static FieldInfo GetField(string name) =>
throw new($"Expected to find field '{name}' on StringBuilder");
}
}
#endif
2 changes: 0 additions & 2 deletions src/Split/uap10.0/StringBuilderPolyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// <auto-generated />
#pragma warning disable
#if !NET12_0_OR_GREATER
namespace Polyfills;
using System;
using System.Reflection;
Expand Down Expand Up @@ -51,4 +50,3 @@ static FieldInfo GetField(string name) =>
throw new($"Expected to find field '{name}' on StringBuilder");
}
}
#endif
13 changes: 13 additions & 0 deletions src/Tests/PolyfillTests_StringBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,19 @@ public async Task MoveChunks()
public async Task MoveChunks_Null_Throws() =>
await Assert.That(() => StringBuilder.MoveChunks(null!)).Throws<ArgumentNullException>();

// Where the BCL declares StringBuilder.MoveChunks the polyfill must not be compiled: a static
// member of the type always wins over a static extension member, so it would be dead code.
[Test]
public async Task MoveChunks_NotPolyfilledWhereBclHasIt()
{
var flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static;
Type[] parameters = [typeof(StringBuilder)];
var inBcl = typeof(StringBuilder).GetMethod("MoveChunks", flags, null, parameters, null) != null;
var inPolyfill = typeof(Polyfills.Polyfill).GetMethod("MoveChunks", flags, null, parameters, null) != null;

await Assert.That(inBcl && inPolyfill).IsFalse();
}

[Test]
public async Task StringBuilder_Insert_ReadOnlySpan()
{
Expand Down
Loading