From 005a5460dbf3e48c734110bc2416153e061efcae Mon Sep 17 00:00:00 2001 From: ig Date: Wed, 30 Aug 2023 16:49:44 +0200 Subject: [PATCH] do not use nullable in operators, .net cannot deal with it yet --- csharp/Lib/Units/Power/ActivePower.cs | 4 +++- csharp/Lib/Units/Power/ReactivePower.cs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/csharp/Lib/Units/Power/ActivePower.cs b/csharp/Lib/Units/Power/ActivePower.cs index 6d859ad50..0fb663a80 100644 --- a/csharp/Lib/Units/Power/ActivePower.cs +++ b/csharp/Lib/Units/Power/ActivePower.cs @@ -12,6 +12,8 @@ public sealed class ActivePower : AcPower public static implicit operator ActivePower(Double d) => new ActivePower(d); public static implicit operator Double(ActivePower d) => d.Value; - public static ActivePower? operator -(ActivePower? d) => -d?.Value; + public static ActivePower operator -(ActivePower d) => -d.Value; + + } diff --git a/csharp/Lib/Units/Power/ReactivePower.cs b/csharp/Lib/Units/Power/ReactivePower.cs index 5c54095ab..ee6bb35cd 100644 --- a/csharp/Lib/Units/Power/ReactivePower.cs +++ b/csharp/Lib/Units/Power/ReactivePower.cs @@ -11,6 +11,6 @@ public sealed class ReactivePower : AcPower public static implicit operator ReactivePower(Double d) => new ReactivePower(d); public static implicit operator Double(ReactivePower d) => d.Value; - public static ReactivePower? operator -(ReactivePower? d) => -d?.Value; + public static ReactivePower operator -(ReactivePower d) => -d.Value; }