Skip to content

Commit

Permalink
Fix CS8600 and CS8602
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverbooth committed Nov 29, 2022
1 parent f3b40d3 commit 8dfe6d5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 4 additions & 2 deletions X10D/src/Drawing/Polygon.cs
@@ -1,4 +1,5 @@
using System.Drawing;
using System.Diagnostics.CodeAnalysis;
using System.Drawing;

namespace X10D.Drawing;

Expand Down Expand Up @@ -128,7 +129,7 @@ public IReadOnlyList<Point> Vertices
/// <see langword="true" /> if <paramref name="left" /> and <paramref name="right" /> are considered not equal; otherwise,
/// <see langword="false" />.
/// </returns>
public static bool operator !=(Polygon left, Polygon right)
public static bool operator !=(Polygon? left, Polygon? right)
{
return !(left == right);
}
Expand All @@ -138,6 +139,7 @@ public IReadOnlyList<Point> Vertices
/// </summary>
/// <param name="polygon">The polygon to convert.</param>
/// <returns>The converted polygon.</returns>
[return: NotNullIfNotNull("polygon")]
public static explicit operator Polygon?(PolygonF? polygon)
{
return polygon is null ? null : FromPolygonF(polygon);
Expand Down
4 changes: 3 additions & 1 deletion X10D/src/Drawing/PolygonF.cs
@@ -1,4 +1,5 @@
using System.Drawing;
using System.Diagnostics.CodeAnalysis;
using System.Drawing;
using System.Numerics;
using X10D.Numerics;

Expand Down Expand Up @@ -169,6 +170,7 @@ public IReadOnlyList<PointF> Vertices
/// </summary>
/// <param name="polygon">The polygon to convert.</param>
/// <returns>The converted polygon.</returns>
[return: NotNullIfNotNull("polygon")]
public static implicit operator PolygonF?(Polygon? polygon)
{
return polygon is null ? null : FromPolygon(polygon);
Expand Down
5 changes: 4 additions & 1 deletion X10D/src/Drawing/Polyhedron.cs
@@ -1,4 +1,5 @@
using System.Drawing;
using System.Diagnostics.CodeAnalysis;
using System.Drawing;
using System.Numerics;

namespace X10D.Drawing;
Expand Down Expand Up @@ -140,6 +141,7 @@ public IReadOnlyList<Vector3> Vertices
/// <returns>
/// The converted polyhedron, or <see langword="null" /> if <paramref name="polygon" /> is <see langword="null" />.
/// </returns>
[return: NotNullIfNotNull("polygon")]
public static implicit operator Polyhedron?(Polygon? polygon)
{
return polygon is null ? null : FromPolygon(polygon);
Expand All @@ -152,6 +154,7 @@ public IReadOnlyList<Vector3> Vertices
/// <returns>
/// The converted polyhedron, or <see langword="null" /> if <paramref name="polygon" /> is <see langword="null" />.
/// </returns>
[return: NotNullIfNotNull("polygon")]
public static implicit operator Polyhedron?(PolygonF? polygon)
{
return polygon is null ? null : FromPolygonF(polygon);
Expand Down

0 comments on commit 8dfe6d5

Please sign in to comment.