Skip to content

Commit

Permalink
Fix .net 9 suppressions
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalBrylka committed Jan 8, 2025
1 parent 190d91d commit b6854dd
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
24 changes: 21 additions & 3 deletions Nemesis.TextParsers/CompatibilitySuppressions.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- https://learn.microsoft.com/en-us/dotnet/fundamentals/package-validation/diagnostic-ids -->
<Suppressions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!-- https://learn.microsoft.com/dotnet/fundamentals/package-validation/diagnostic-ids -->
<Suppressions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Suppression>
<DiagnosticId>CP0006</DiagnosticId>
<Target>P:Nemesis.TextParsers.Settings.ISettings`1.Default</Target>
<Left>lib/net6.0/Nemesis.TextParsers.dll</Left>
<Left>lib/netstandard2.0/Nemesis.TextParsers.dll</Left>
<Right>lib/net8.0/Nemesis.TextParsers.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0021</DiagnosticId>
<Target>M:Nemesis.TextParsers.Parsers.NumberTransformerCache.GetNumberHandler``1``0:T:System.Numerics.IBinaryInteger{``0}</Target>
<Left>lib/netstandard2.0/Nemesis.TextParsers.dll</Left>
<Right>lib/net8.0/Nemesis.TextParsers.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0021</DiagnosticId>
<Target>T:Nemesis.TextParsers.Parsers.EnumTransformer`3``1:T:System.Numerics.IBinaryInteger{`1}</Target>
<Left>lib/netstandard2.0/Nemesis.TextParsers.dll</Left>
<Right>lib/net8.0/Nemesis.TextParsers.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0021</DiagnosticId>
<Target>T:Nemesis.TextParsers.Parsers.NumberTransformer`1``0:T:System.Numerics.IBinaryInteger{`0}</Target>
<Left>lib/netstandard2.0/Nemesis.TextParsers.dll</Left>
<Right>lib/net8.0/Nemesis.TextParsers.dll</Right>
</Suppression>
</Suppressions>
9 changes: 7 additions & 2 deletions Nemesis.TextParsers/Nemesis.TextParsers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,18 @@

<!--Legacy on-->
<PropertyGroup>
<AllowUnsafeBlocks Condition=" '$(TargetFramework)' == 'netstandard2.0' ">true</AllowUnsafeBlocks>
<ApiCompatGenerateSuppressionFile>true</ApiCompatGenerateSuppressionFile>
<ApiCompatPermitUnnecessarySuppressions>true</ApiCompatPermitUnnecessarySuppressions>
</PropertyGroup>

<PropertyGroup>
<AllowUnsafeBlocks Condition=" '$(TargetFramework)' == 'netstandard2.0' ">true</AllowUnsafeBlocks>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="System.Memory" />
</ItemGroup>

<!--Legacy off-->

</Project>
5 changes: 4 additions & 1 deletion Nemesis.TextParsers/SpanSplit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

namespace Nemesis.TextParsers;

#if NET9_0_OR_GREATER
//[Obsolete("Use approprtiate System.MemoryExtensions.Split method", false)]
#endif
public static class SpanSplitExtensions
{
#region Enumerators
public readonly ref struct Enumerable1<T> where T : IEquatable<T>
{
public Enumerable1(ReadOnlySpan<T> sequence, T separator, bool emptySequenceYieldsEmpty)
{
{
_sequence = sequence;
_separator = separator;
_emptySequenceYieldsEmpty = emptySequenceYieldsEmpty;
Expand Down

0 comments on commit b6854dd

Please sign in to comment.