Skip to content

Commit 62fb204

Browse files
committed
Nullable: System.Object (dotnet#23466)
1 parent 90f5615 commit 62fb204

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/System.Private.CoreLib/shared/System/Object.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5+
#nullable enable
56
using System.Runtime.CompilerServices;
67
using System.Runtime.InteropServices;
78
using System.Runtime.Versioning;
@@ -44,12 +45,12 @@ public virtual string ToString()
4445
// Equal to this. Equality is defined as object equality for reference
4546
// types and bitwise equality for value types using a loader trick to
4647
// replace Equals with EqualsValue for value types).
47-
public virtual bool Equals(object obj)
48+
public virtual bool Equals(object? obj)
4849
{
4950
return RuntimeHelpers.Equals(this, obj);
5051
}
5152

52-
public static bool Equals(object objA, object objB)
53+
public static bool Equals(object? objA, object? objB)
5354
{
5455
if (objA == objB)
5556
{
@@ -63,7 +64,7 @@ public static bool Equals(object objA, object objB)
6364
}
6465

6566
[NonVersionable]
66-
public static bool ReferenceEquals(object objA, object objB)
67+
public static bool ReferenceEquals(object? objA, object? objB)
6768
{
6869
return objA == objB;
6970
}

src/System.Private.CoreLib/src/System/Object.CoreCLR.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5+
#nullable enable
56
using System.Runtime.CompilerServices;
67

78
namespace System

0 commit comments

Comments
 (0)