do not use nullable in operators, .net cannot deal with it yet

This commit is contained in:
ig 2023-08-30 16:49:44 +02:00
parent d09c53ad92
commit 005a5460db
2 changed files with 4 additions and 2 deletions

View File

@ -12,6 +12,8 @@ public sealed class ActivePower : AcPower
public static implicit operator ActivePower(Double d) => new ActivePower(d); public static implicit operator ActivePower(Double d) => new ActivePower(d);
public static implicit operator Double(ActivePower d) => d.Value; 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;
} }

View File

@ -11,6 +11,6 @@ public sealed class ReactivePower : AcPower
public static implicit operator ReactivePower(Double d) => new ReactivePower(d); public static implicit operator ReactivePower(Double d) => new ReactivePower(d);
public static implicit operator Double(ReactivePower d) => d.Value; 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;
} }