Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Nullable: System.Object (#23466)
Browse files Browse the repository at this point in the history
  • Loading branch information
safern committed Mar 28, 2019
1 parent 90f5615 commit 62fb204
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/System.Private.CoreLib/shared/System/Object.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#nullable enable
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
Expand Down Expand Up @@ -44,12 +45,12 @@ public virtual string ToString()
// Equal to this. Equality is defined as object equality for reference
// types and bitwise equality for value types using a loader trick to
// replace Equals with EqualsValue for value types).
public virtual bool Equals(object obj)
public virtual bool Equals(object? obj)
{
return RuntimeHelpers.Equals(this, obj);
}

public static bool Equals(object objA, object objB)
public static bool Equals(object? objA, object? objB)
{
if (objA == objB)
{
Expand All @@ -63,7 +64,7 @@ public static bool Equals(object objA, object objB)
}

[NonVersionable]
public static bool ReferenceEquals(object objA, object objB)
public static bool ReferenceEquals(object? objA, object? objB)
{
return objA == objB;
}
Expand Down
1 change: 1 addition & 0 deletions src/System.Private.CoreLib/src/System/Object.CoreCLR.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#nullable enable
using System.Runtime.CompilerServices;

namespace System
Expand Down

0 comments on commit 62fb204

Please sign in to comment.