From 482424064b94a407c59c91890523e0fca5a51d52 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Sun, 7 Jun 2026 22:09:19 +1000 Subject: [PATCH] struct Range: invalid parameter names --- apiCount.include.md | 24 ++++++------- assemblySize.include.md | 36 ++++++++++---------- src/Consume/Consume.cs | 2 ++ src/Directory.Build.props | 2 +- src/Polyfill/IndexRange/Range.cs | 15 +++++++- src/Split/net461/IndexRange/Range.cs | 12 ++++++- src/Split/net462/IndexRange/Range.cs | 12 ++++++- src/Split/net47/IndexRange/Range.cs | 12 ++++++- src/Split/net471/IndexRange/Range.cs | 12 ++++++- src/Split/net472/IndexRange/Range.cs | 12 ++++++- src/Split/net48/IndexRange/Range.cs | 12 ++++++- src/Split/net481/IndexRange/Range.cs | 12 ++++++- src/Split/netcoreapp2.0/IndexRange/Range.cs | 12 ++++++- src/Split/netcoreapp2.1/IndexRange/Range.cs | 12 ++++++- src/Split/netcoreapp2.2/IndexRange/Range.cs | 12 ++++++- src/Split/netstandard2.0/IndexRange/Range.cs | 12 ++++++- src/Split/uap10.0/IndexRange/Range.cs | 12 ++++++- 17 files changed, 179 insertions(+), 44 deletions(-) diff --git a/apiCount.include.md b/apiCount.include.md index 9ca1f8c6..308fbf4e 100644 --- a/apiCount.include.md +++ b/apiCount.include.md @@ -13,16 +13,16 @@ | `net481` | 930 | | `netstandard2.0` | 932 | | `netstandard2.1` | 763 | -| `netcoreapp2.0` | 856 | -| `netcoreapp2.1` | 775 | -| `netcoreapp2.2` | 775 | -| `netcoreapp3.0` | 721 | -| `netcoreapp3.1` | 720 | -| `net5.0` | 592 | -| `net6.0` | 497 | -| `net7.0` | 344 | -| `net8.0` | 225 | -| `net9.0` | 149 | -| `net10.0` | 96 | -| `net11.0` | 59 | +| `netcoreapp2.0` | 855 | +| `netcoreapp2.1` | 774 | +| `netcoreapp2.2` | 774 | +| `netcoreapp3.0` | 720 | +| `netcoreapp3.1` | 719 | +| `net5.0` | 591 | +| `net6.0` | 496 | +| `net7.0` | 343 | +| `net8.0` | 224 | +| `net9.0` | 148 | +| `net10.0` | 95 | +| `net11.0` | 58 | | `uap10.0` | 922 | diff --git a/assemblySize.include.md b/assemblySize.include.md index b292bf89..69681623 100644 --- a/assemblySize.include.md +++ b/assemblySize.include.md @@ -13,14 +13,14 @@ | net481 | 8.5KB | 327.0KB | +318.5KB | +8.5KB | +6.5KB | +9.0KB | +13.5KB | | netcoreapp2.0 | 9.0KB | 303.0KB | +294.0KB | +9.0KB | +6.5KB | +9.0KB | +14.0KB | | netcoreapp2.1 | 9.0KB | 282.5KB | +273.5KB | +9.0KB | +7.0KB | +9.5KB | +14.0KB | -| netcoreapp2.2 | 9.0KB | 283.0KB | +274.0KB | +8.5KB | +6.5KB | +9.0KB | +13.5KB | +| netcoreapp2.2 | 9.0KB | 282.5KB | +273.5KB | +9.0KB | +7.0KB | +9.5KB | +14.0KB | | netcoreapp3.0 | 9.5KB | 274.5KB | +265.0KB | +9.0KB | +6.5KB | +9.0KB | +13.5KB | | netcoreapp3.1 | 9.5KB | 272.5KB | +263.0KB | +9.0KB | +6.5KB | +9.5KB | +14.0KB | -| net5.0 | 9.5KB | 236.0KB | +226.5KB | +9.5KB | +6.5KB | +9.5KB | +14.5KB | -| net6.0 | 10.0KB | 177.0KB | +167.0KB | +10.0KB | +7.5KB | +1.0KB | +4.0KB | -| net7.0 | 10.0KB | 139.5KB | +129.5KB | +9.5KB | +5.5KB | +512bytes | +4.0KB | -| net8.0 | 9.5KB | 111.0KB | +101.5KB | +8.5KB | +512bytes | +512bytes | +3.5KB | -| net9.0 | 9.5KB | 67.5KB | +58.0KB | +8.5KB | | +512bytes | +3.5KB | +| net5.0 | 9.5KB | 236.0KB | +226.5KB | +9.0KB | +6.5KB | +9.5KB | +14.5KB | +| net6.0 | 10.0KB | 177.0KB | +167.0KB | +10.0KB | +7.5KB | +512bytes | +4.0KB | +| net7.0 | 10.0KB | 139.5KB | +129.5KB | +9.5KB | +5.5KB | +512bytes | +3.5KB | +| net8.0 | 9.5KB | 111.0KB | +101.5KB | +8.5KB | | +512bytes | +3.5KB | +| net9.0 | 9.5KB | 67.5KB | +58.0KB | +8.5KB | | +512bytes | +3.0KB | | net10.0 | 10.0KB | 43.5KB | +33.5KB | +9.0KB | | +512bytes | +3.5KB | | net11.0 | 10.0KB | 20.5KB | +10.5KB | +9.0KB | | +512bytes | +3.5KB | @@ -38,15 +38,15 @@ | net472 | 8.5KB | 475.7KB | +467.2KB | +16.2KB | +8.2KB | +13.9KB | +18.9KB | | net48 | 8.5KB | 475.7KB | +467.2KB | +16.2KB | +8.2KB | +13.9KB | +18.9KB | | net481 | 8.5KB | 475.7KB | +467.2KB | +16.2KB | +8.2KB | +13.9KB | +18.9KB | -| netcoreapp2.0 | 9.0KB | 442.5KB | +433.5KB | +16.7KB | +8.2KB | +13.9KB | +19.4KB | -| netcoreapp2.1 | 9.0KB | 410.8KB | +401.8KB | +16.7KB | +8.7KB | +14.4KB | +19.4KB | -| netcoreapp2.2 | 9.0KB | 411.3KB | +402.3KB | +16.2KB | +8.2KB | +13.9KB | +18.9KB | -| netcoreapp3.0 | 9.5KB | 393.5KB | +384.0KB | +16.7KB | +8.2KB | +13.9KB | +18.9KB | -| netcoreapp3.1 | 9.5KB | 391.5KB | +382.0KB | +16.7KB | +8.2KB | +14.4KB | +19.4KB | -| net5.0 | 9.5KB | 336.8KB | +327.3KB | +17.2KB | +8.2KB | +14.4KB | +19.9KB | -| net6.0 | 10.0KB | 257.8KB | +247.8KB | +17.7KB | +9.2KB | +1.6KB | +4.7KB | -| net7.0 | 10.0KB | 201.8KB | +191.8KB | +17.1KB | +6.9KB | +1.1KB | +4.7KB | -| net8.0 | 9.5KB | 158.0KB | +148.5KB | +16.0KB | +811bytes | +1.1KB | +4.2KB | -| net9.0 | 9.5KB | 94.1KB | +84.6KB | +16.0KB | | +1.1KB | +4.2KB | -| net10.0 | 10.0KB | 61.2KB | +51.2KB | +16.5KB | | +1.1KB | +4.2KB | -| net11.0 | 10.0KB | 30.8KB | +20.8KB | +16.5KB | | +1.1KB | +4.2KB | +| netcoreapp2.0 | 9.0KB | 441.9KB | +432.9KB | +16.7KB | +8.2KB | +13.9KB | +19.4KB | +| netcoreapp2.1 | 9.0KB | 410.3KB | +401.3KB | +16.7KB | +8.7KB | +14.4KB | +19.4KB | +| netcoreapp2.2 | 9.0KB | 410.3KB | +401.3KB | +16.7KB | +8.7KB | +14.4KB | +19.4KB | +| netcoreapp3.0 | 9.5KB | 393.0KB | +383.5KB | +16.7KB | +8.2KB | +13.9KB | +18.9KB | +| netcoreapp3.1 | 9.5KB | 391.0KB | +381.5KB | +16.7KB | +8.2KB | +14.4KB | +19.4KB | +| net5.0 | 9.5KB | 336.3KB | +326.8KB | +16.7KB | +8.2KB | +14.4KB | +19.9KB | +| net6.0 | 10.0KB | 257.3KB | +247.3KB | +17.7KB | +9.2KB | +1.1KB | +4.7KB | +| net7.0 | 10.0KB | 201.2KB | +191.2KB | +17.1KB | +6.9KB | +1.1KB | +4.2KB | +| net8.0 | 9.5KB | 157.4KB | +147.9KB | +16.0KB | +299bytes | +1.1KB | +4.2KB | +| net9.0 | 9.5KB | 93.6KB | +84.1KB | +16.0KB | | +1.1KB | +3.7KB | +| net10.0 | 10.0KB | 60.7KB | +50.7KB | +16.5KB | | +1.1KB | +4.2KB | +| net11.0 | 10.0KB | 30.3KB | +20.3KB | +16.5KB | | +1.1KB | +4.2KB | diff --git a/src/Consume/Consume.cs b/src/Consume/Consume.cs index 317e5706..d87d595e 100644 --- a/src/Consume/Consume.cs +++ b/src/Consume/Consume.cs @@ -397,6 +397,8 @@ void Ranges() { var range = "value"[1..]; var index = "value"[^2]; + // named constructor parameters must match the BCL (lowercase start/end) + var namedRange = new Range(start: Index.Start, end: Index.End); //Array not supported due to no RuntimeHelpers.GetSubArray // var subArray = new[] // { diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 1dcb2d9b..bdac1091 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -2,7 +2,7 @@ CS1591;NETSDK1138;NU1901;NU1902;NU1903;CA1822;CA1847;CA1861;NU1510;NU1608;NU1109 - 10.8.0 + 10.8.1 1.0.0 Polyfill true diff --git a/src/Polyfill/IndexRange/Range.cs b/src/Polyfill/IndexRange/Range.cs index 677e32af..0d5fb0f0 100644 --- a/src/Polyfill/IndexRange/Range.cs +++ b/src/Polyfill/IndexRange/Range.cs @@ -16,8 +16,21 @@ namespace System; #if PolyPublic public #endif -readonly record struct Range(Index Start, Index End) +readonly record struct Range { + /// Represent the inclusive start index of the Range. + public Index Start { get; } + + /// Represent the exclusive end index of the Range. + public Index End { get; } + + /// Construct a Range object using the start and end indexes. + public Range(Index start, Index end) + { + Start = start; + End = end; + } + /// Converts the value of the current Range object to its equivalent string representation. public override string ToString() => $"{Start}..{End}"; diff --git a/src/Split/net461/IndexRange/Range.cs b/src/Split/net461/IndexRange/Range.cs index 1f5c0591..99b0a8b7 100644 --- a/src/Split/net461/IndexRange/Range.cs +++ b/src/Split/net461/IndexRange/Range.cs @@ -14,8 +14,18 @@ namespace System; #if PolyPublic public #endif -readonly record struct Range(Index Start, Index End) +readonly record struct Range { + /// Represent the inclusive start index of the Range. + public Index Start { get; } + /// Represent the exclusive end index of the Range. + public Index End { get; } + /// Construct a Range object using the start and end indexes. + public Range(Index start, Index end) + { + Start = start; + End = end; + } /// Converts the value of the current Range object to its equivalent string representation. public override string ToString() => $"{Start}..{End}"; diff --git a/src/Split/net462/IndexRange/Range.cs b/src/Split/net462/IndexRange/Range.cs index 1f5c0591..99b0a8b7 100644 --- a/src/Split/net462/IndexRange/Range.cs +++ b/src/Split/net462/IndexRange/Range.cs @@ -14,8 +14,18 @@ namespace System; #if PolyPublic public #endif -readonly record struct Range(Index Start, Index End) +readonly record struct Range { + /// Represent the inclusive start index of the Range. + public Index Start { get; } + /// Represent the exclusive end index of the Range. + public Index End { get; } + /// Construct a Range object using the start and end indexes. + public Range(Index start, Index end) + { + Start = start; + End = end; + } /// Converts the value of the current Range object to its equivalent string representation. public override string ToString() => $"{Start}..{End}"; diff --git a/src/Split/net47/IndexRange/Range.cs b/src/Split/net47/IndexRange/Range.cs index 1f5c0591..99b0a8b7 100644 --- a/src/Split/net47/IndexRange/Range.cs +++ b/src/Split/net47/IndexRange/Range.cs @@ -14,8 +14,18 @@ namespace System; #if PolyPublic public #endif -readonly record struct Range(Index Start, Index End) +readonly record struct Range { + /// Represent the inclusive start index of the Range. + public Index Start { get; } + /// Represent the exclusive end index of the Range. + public Index End { get; } + /// Construct a Range object using the start and end indexes. + public Range(Index start, Index end) + { + Start = start; + End = end; + } /// Converts the value of the current Range object to its equivalent string representation. public override string ToString() => $"{Start}..{End}"; diff --git a/src/Split/net471/IndexRange/Range.cs b/src/Split/net471/IndexRange/Range.cs index 1f5c0591..99b0a8b7 100644 --- a/src/Split/net471/IndexRange/Range.cs +++ b/src/Split/net471/IndexRange/Range.cs @@ -14,8 +14,18 @@ namespace System; #if PolyPublic public #endif -readonly record struct Range(Index Start, Index End) +readonly record struct Range { + /// Represent the inclusive start index of the Range. + public Index Start { get; } + /// Represent the exclusive end index of the Range. + public Index End { get; } + /// Construct a Range object using the start and end indexes. + public Range(Index start, Index end) + { + Start = start; + End = end; + } /// Converts the value of the current Range object to its equivalent string representation. public override string ToString() => $"{Start}..{End}"; diff --git a/src/Split/net472/IndexRange/Range.cs b/src/Split/net472/IndexRange/Range.cs index 1f5c0591..99b0a8b7 100644 --- a/src/Split/net472/IndexRange/Range.cs +++ b/src/Split/net472/IndexRange/Range.cs @@ -14,8 +14,18 @@ namespace System; #if PolyPublic public #endif -readonly record struct Range(Index Start, Index End) +readonly record struct Range { + /// Represent the inclusive start index of the Range. + public Index Start { get; } + /// Represent the exclusive end index of the Range. + public Index End { get; } + /// Construct a Range object using the start and end indexes. + public Range(Index start, Index end) + { + Start = start; + End = end; + } /// Converts the value of the current Range object to its equivalent string representation. public override string ToString() => $"{Start}..{End}"; diff --git a/src/Split/net48/IndexRange/Range.cs b/src/Split/net48/IndexRange/Range.cs index 1f5c0591..99b0a8b7 100644 --- a/src/Split/net48/IndexRange/Range.cs +++ b/src/Split/net48/IndexRange/Range.cs @@ -14,8 +14,18 @@ namespace System; #if PolyPublic public #endif -readonly record struct Range(Index Start, Index End) +readonly record struct Range { + /// Represent the inclusive start index of the Range. + public Index Start { get; } + /// Represent the exclusive end index of the Range. + public Index End { get; } + /// Construct a Range object using the start and end indexes. + public Range(Index start, Index end) + { + Start = start; + End = end; + } /// Converts the value of the current Range object to its equivalent string representation. public override string ToString() => $"{Start}..{End}"; diff --git a/src/Split/net481/IndexRange/Range.cs b/src/Split/net481/IndexRange/Range.cs index 1f5c0591..99b0a8b7 100644 --- a/src/Split/net481/IndexRange/Range.cs +++ b/src/Split/net481/IndexRange/Range.cs @@ -14,8 +14,18 @@ namespace System; #if PolyPublic public #endif -readonly record struct Range(Index Start, Index End) +readonly record struct Range { + /// Represent the inclusive start index of the Range. + public Index Start { get; } + /// Represent the exclusive end index of the Range. + public Index End { get; } + /// Construct a Range object using the start and end indexes. + public Range(Index start, Index end) + { + Start = start; + End = end; + } /// Converts the value of the current Range object to its equivalent string representation. public override string ToString() => $"{Start}..{End}"; diff --git a/src/Split/netcoreapp2.0/IndexRange/Range.cs b/src/Split/netcoreapp2.0/IndexRange/Range.cs index 1f5c0591..99b0a8b7 100644 --- a/src/Split/netcoreapp2.0/IndexRange/Range.cs +++ b/src/Split/netcoreapp2.0/IndexRange/Range.cs @@ -14,8 +14,18 @@ namespace System; #if PolyPublic public #endif -readonly record struct Range(Index Start, Index End) +readonly record struct Range { + /// Represent the inclusive start index of the Range. + public Index Start { get; } + /// Represent the exclusive end index of the Range. + public Index End { get; } + /// Construct a Range object using the start and end indexes. + public Range(Index start, Index end) + { + Start = start; + End = end; + } /// Converts the value of the current Range object to its equivalent string representation. public override string ToString() => $"{Start}..{End}"; diff --git a/src/Split/netcoreapp2.1/IndexRange/Range.cs b/src/Split/netcoreapp2.1/IndexRange/Range.cs index 1f5c0591..99b0a8b7 100644 --- a/src/Split/netcoreapp2.1/IndexRange/Range.cs +++ b/src/Split/netcoreapp2.1/IndexRange/Range.cs @@ -14,8 +14,18 @@ namespace System; #if PolyPublic public #endif -readonly record struct Range(Index Start, Index End) +readonly record struct Range { + /// Represent the inclusive start index of the Range. + public Index Start { get; } + /// Represent the exclusive end index of the Range. + public Index End { get; } + /// Construct a Range object using the start and end indexes. + public Range(Index start, Index end) + { + Start = start; + End = end; + } /// Converts the value of the current Range object to its equivalent string representation. public override string ToString() => $"{Start}..{End}"; diff --git a/src/Split/netcoreapp2.2/IndexRange/Range.cs b/src/Split/netcoreapp2.2/IndexRange/Range.cs index 1f5c0591..99b0a8b7 100644 --- a/src/Split/netcoreapp2.2/IndexRange/Range.cs +++ b/src/Split/netcoreapp2.2/IndexRange/Range.cs @@ -14,8 +14,18 @@ namespace System; #if PolyPublic public #endif -readonly record struct Range(Index Start, Index End) +readonly record struct Range { + /// Represent the inclusive start index of the Range. + public Index Start { get; } + /// Represent the exclusive end index of the Range. + public Index End { get; } + /// Construct a Range object using the start and end indexes. + public Range(Index start, Index end) + { + Start = start; + End = end; + } /// Converts the value of the current Range object to its equivalent string representation. public override string ToString() => $"{Start}..{End}"; diff --git a/src/Split/netstandard2.0/IndexRange/Range.cs b/src/Split/netstandard2.0/IndexRange/Range.cs index 1f5c0591..99b0a8b7 100644 --- a/src/Split/netstandard2.0/IndexRange/Range.cs +++ b/src/Split/netstandard2.0/IndexRange/Range.cs @@ -14,8 +14,18 @@ namespace System; #if PolyPublic public #endif -readonly record struct Range(Index Start, Index End) +readonly record struct Range { + /// Represent the inclusive start index of the Range. + public Index Start { get; } + /// Represent the exclusive end index of the Range. + public Index End { get; } + /// Construct a Range object using the start and end indexes. + public Range(Index start, Index end) + { + Start = start; + End = end; + } /// Converts the value of the current Range object to its equivalent string representation. public override string ToString() => $"{Start}..{End}"; diff --git a/src/Split/uap10.0/IndexRange/Range.cs b/src/Split/uap10.0/IndexRange/Range.cs index 1f5c0591..99b0a8b7 100644 --- a/src/Split/uap10.0/IndexRange/Range.cs +++ b/src/Split/uap10.0/IndexRange/Range.cs @@ -14,8 +14,18 @@ namespace System; #if PolyPublic public #endif -readonly record struct Range(Index Start, Index End) +readonly record struct Range { + /// Represent the inclusive start index of the Range. + public Index Start { get; } + /// Represent the exclusive end index of the Range. + public Index End { get; } + /// Construct a Range object using the start and end indexes. + public Range(Index start, Index end) + { + Start = start; + End = end; + } /// Converts the value of the current Range object to its equivalent string representation. public override string ToString() => $"{Start}..{End}";