Skip to content

Commit 1fab5d8

Browse files
committed
Fix: non-generic implementation of IComparable doesn't need a cast.
1 parent 634413f commit 1fab5d8

65 files changed

Lines changed: 67 additions & 64 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<Copyright>(c) $([System.DateTime]::Now.Year), Pawel Gerr. All rights reserved.</Copyright>
5-
<VersionPrefix>9.5.1</VersionPrefix>
5+
<VersionPrefix>9.5.2</VersionPrefix>
66
<Authors>Pawel Gerr</Authors>
77
<GenerateDocumentationFile>true</GenerateDocumentationFile>
88
<PackageProjectUrl>https://github.com/PawelGerr/Thinktecture.Runtime.Extensions</PackageProjectUrl>

src/Thinktecture.Runtime.Extensions.SourceGenerator/CodeAnalysis/ComparableCodeGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public int CompareTo(object? obj)
3535
if(obj is not ").AppendTypeFullyQualified(state.Type).Append(@" item)
3636
throw new global::System.ArgumentException(""Argument must be of type \""").AppendTypeMinimallyQualified(state.Type).Append(@"\""."", nameof(obj));
3737
38-
return ((global::System.IComparable)this).CompareTo(item);
38+
return this.CompareTo(item);
3939
}
4040
4141
/// <inheritdoc />

test/Thinktecture.Runtime.Extensions.SourceGenerator.Tests/SourceGeneratorTests/SmartEnumSourceGeneratorTests.Should_change_conversion_from_key_Explicit1.verified.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ partial class TestEnum :
1616
if(obj is not global::Thinktecture.Tests.TestEnum item)
1717
throw new global::System.ArgumentException("Argument must be of type \"TestEnum\".", nameof(obj));
1818

19-
return ((global::System.IComparable)this).CompareTo(item);
19+
return this.CompareTo(item);
2020
}
2121

2222
/// <inheritdoc />

test/Thinktecture.Runtime.Extensions.SourceGenerator.Tests/SourceGeneratorTests/SmartEnumSourceGeneratorTests.Should_change_conversion_from_key_Implicit1.verified.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ partial class TestEnum :
1616
if(obj is not global::Thinktecture.Tests.TestEnum item)
1717
throw new global::System.ArgumentException("Argument must be of type \"TestEnum\".", nameof(obj));
1818

19-
return ((global::System.IComparable)this).CompareTo(item);
19+
return this.CompareTo(item);
2020
}
2121

2222
/// <inheritdoc />

test/Thinktecture.Runtime.Extensions.SourceGenerator.Tests/SourceGeneratorTests/SmartEnumSourceGeneratorTests.Should_change_conversion_from_key_None1.verified.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ partial class TestEnum :
1616
if(obj is not global::Thinktecture.Tests.TestEnum item)
1717
throw new global::System.ArgumentException("Argument must be of type \"TestEnum\".", nameof(obj));
1818

19-
return ((global::System.IComparable)this).CompareTo(item);
19+
return this.CompareTo(item);
2020
}
2121

2222
/// <inheritdoc />

test/Thinktecture.Runtime.Extensions.SourceGenerator.Tests/SourceGeneratorTests/SmartEnumSourceGeneratorTests.Should_change_conversion_to_key_Explicit1.verified.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ partial class TestEnum :
1616
if(obj is not global::Thinktecture.Tests.TestEnum item)
1717
throw new global::System.ArgumentException("Argument must be of type \"TestEnum\".", nameof(obj));
1818

19-
return ((global::System.IComparable)this).CompareTo(item);
19+
return this.CompareTo(item);
2020
}
2121

2222
/// <inheritdoc />

test/Thinktecture.Runtime.Extensions.SourceGenerator.Tests/SourceGeneratorTests/SmartEnumSourceGeneratorTests.Should_change_conversion_to_key_Implicit1.verified.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ partial class TestEnum :
1616
if(obj is not global::Thinktecture.Tests.TestEnum item)
1717
throw new global::System.ArgumentException("Argument must be of type \"TestEnum\".", nameof(obj));
1818

19-
return ((global::System.IComparable)this).CompareTo(item);
19+
return this.CompareTo(item);
2020
}
2121

2222
/// <inheritdoc />

test/Thinktecture.Runtime.Extensions.SourceGenerator.Tests/SourceGeneratorTests/SmartEnumSourceGeneratorTests.Should_change_conversion_to_key_None1.verified.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ partial class TestEnum :
1616
if(obj is not global::Thinktecture.Tests.TestEnum item)
1717
throw new global::System.ArgumentException("Argument must be of type \"TestEnum\".", nameof(obj));
1818

19-
return ((global::System.IComparable)this).CompareTo(item);
19+
return this.CompareTo(item);
2020
}
2121

2222
/// <inheritdoc />

test/Thinktecture.Runtime.Extensions.SourceGenerator.Tests/SourceGeneratorTests/SmartEnumSourceGeneratorTests.Should_generate_class_with_abstract_property_1.verified.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ partial class TestEnum :
1616
if(obj is not global::Thinktecture.Tests.TestEnum item)
1717
throw new global::System.ArgumentException("Argument must be of type \"TestEnum\".", nameof(obj));
1818

19-
return ((global::System.IComparable)this).CompareTo(item);
19+
return this.CompareTo(item);
2020
}
2121

2222
/// <inheritdoc />

test/Thinktecture.Runtime.Extensions.SourceGenerator.Tests/SourceGeneratorTests/SmartEnumSourceGeneratorTests.Should_generate_custom_delegate_with_in_parameter_1.verified.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ partial class TestEnum :
1616
if(obj is not global::Thinktecture.Tests.TestEnum item)
1717
throw new global::System.ArgumentException("Argument must be of type \"TestEnum\".", nameof(obj));
1818

19-
return ((global::System.IComparable)this).CompareTo(item);
19+
return this.CompareTo(item);
2020
}
2121

2222
/// <inheritdoc />

0 commit comments

Comments
 (0)