Skip to content

Commit 677a5b9

Browse files
authored
Fix quantity name in obsolete attributes (#1221)
Hard coded value had snuck in.
1 parent 71376ad commit 677a5b9

File tree

124 files changed

+537
-537
lines changed

Some content is hidden

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

124 files changed

+537
-537
lines changed

CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -750,15 +750,15 @@ private void GenerateEqualityAndComparison()
750750
751751
/// <summary>Indicates strict equality of two <see cref=""{_quantity.Name}""/> quantities, where both <see cref=""Value"" /> and <see cref=""Unit"" /> are exactly equal.</summary>
752752
/// <remarks>Consider using <see cref=""Equals({_quantity.Name}, {_valueType}, ComparisonType)""/> to check equality across different units and to specify a floating-point number error tolerance.</remarks>
753-
[Obsolete(""For null checks, use `x is null` syntax to not invoke overloads. For quantity comparisons, use Equals(Angle, {_valueType}, ComparisonType) to check equality across different units and to specify a floating-point number error tolerance."")]
753+
[Obsolete(""For null checks, use `x is null` syntax to not invoke overloads. For quantity comparisons, use Equals({_quantity.Name}, {_valueType}, ComparisonType) to check equality across different units and to specify a floating-point number error tolerance."")]
754754
public static bool operator ==({_quantity.Name} left, {_quantity.Name} right)
755755
{{
756756
return left.Equals(right);
757757
}}
758758
759759
/// <summary>Indicates strict inequality of two <see cref=""{_quantity.Name}""/> quantities, where both <see cref=""Value"" /> and <see cref=""Unit"" /> are exactly equal.</summary>
760760
/// <remarks>Consider using <see cref=""Equals({_quantity.Name}, {_valueType}, ComparisonType)""/> to check equality across different units and to specify a floating-point number error tolerance.</remarks>
761-
[Obsolete(""For null checks, use `x is not null` syntax to not invoke overloads. For quantity comparisons, use Equals(Angle, {_valueType}, ComparisonType) to check equality across different units and to specify a floating-point number error tolerance."")]
761+
[Obsolete(""For null checks, use `x is not null` syntax to not invoke overloads. For quantity comparisons, use Equals({_quantity.Name}, {_valueType}, ComparisonType) to check equality across different units and to specify a floating-point number error tolerance."")]
762762
public static bool operator !=({_quantity.Name} left, {_quantity.Name} right)
763763
{{
764764
return !(left == right);
@@ -767,7 +767,7 @@ private void GenerateEqualityAndComparison()
767767
/// <inheritdoc />
768768
/// <summary>Indicates strict equality of two <see cref=""{_quantity.Name}""/> quantities, where both <see cref=""Value"" /> and <see cref=""Unit"" /> are exactly equal.</summary>
769769
/// <remarks>Consider using <see cref=""Equals({_quantity.Name}, {_valueType}, ComparisonType)""/> to check equality across different units and to specify a floating-point number error tolerance.</remarks>
770-
[Obsolete(""Consider using Equals(Angle, {_valueType}, ComparisonType) to check equality across different units and to specify a floating-point number error tolerance."")]
770+
[Obsolete(""Consider using Equals({_quantity.Name}, {_valueType}, ComparisonType) to check equality across different units and to specify a floating-point number error tolerance."")]
771771
public override bool Equals(object? obj)
772772
{{
773773
if (obj is null || !(obj is {_quantity.Name} otherQuantity))
@@ -779,7 +779,7 @@ public override bool Equals(object? obj)
779779
/// <inheritdoc />
780780
/// <summary>Indicates strict equality of two <see cref=""{_quantity.Name}""/> quantities, where both <see cref=""Value"" /> and <see cref=""Unit"" /> are exactly equal.</summary>
781781
/// <remarks>Consider using <see cref=""Equals({_quantity.Name}, {_valueType}, ComparisonType)""/> to check equality across different units and to specify a floating-point number error tolerance.</remarks>
782-
[Obsolete(""Consider using Equals(Angle, {_valueType}, ComparisonType) to check equality across different units and to specify a floating-point number error tolerance."")]
782+
[Obsolete(""Consider using Equals({_quantity.Name}, {_valueType}, ComparisonType) to check equality across different units and to specify a floating-point number error tolerance."")]
783783
public bool Equals({_quantity.Name} other)
784784
{{
785785
return new {{ Value, Unit }}.Equals(new {{ other.Value, other.Unit }});

UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricCharge.g.cs

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet.NanoFramework/GeneratedCode/Units/ElectricChargeUnit.g.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToElectricChargeExtensionsTest.g.cs

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet.NumberExtensions/GeneratedCode/NumberToElectricChargeExtensions.g.cs

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)