Skip to content

Commit 352c424

Browse files
authored
Fix nullable cast (#46)
In a future version of the compiler, this cast is a warning (csc version 3.10, change introduce [here](dotnet/roslyn#48803)) This resolves the warning for this case.
1 parent 8e86f1d commit 352c424

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Sdk/AssertEqualityComparerAdapter.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,15 @@ public AssertEqualityComparerAdapter(IEqualityComparer<T> innerComparer)
3131
/// <inheritdoc/>
3232
#if XUNIT_NULLABLE
3333
public new bool Equals(object? x, object? y)
34+
{
35+
return innerComparer.Equals((T?)x, (T?)y);
36+
}
3437
#else
3538
public new bool Equals(object x, object y)
36-
#endif
3739
{
3840
return innerComparer.Equals((T)x, (T)y);
3941
}
42+
#endif
4043

4144
/// <inheritdoc/>
4245
public int GetHashCode(object obj)

0 commit comments

Comments
 (0)