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

Commit dbc0e19

Browse files
safernstephentoub
authored andcommittedJul 17, 2019
Fix nullability warnings from compiler update
1 parent 04a7796 commit dbc0e19

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed
 

‎src/System.Private.CoreLib/shared/System/AppDomain.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +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-
#pragma warning disable CS0067 // events are declared but not used
5+
#pragma warning disable CS0414 // events are assigned but not used
66

77
using System.Diagnostics;
88
using System.IO;
@@ -67,7 +67,7 @@ public string FriendlyName
6767

6868
public bool IsHomogenous => true;
6969

70-
public event EventHandler DomainUnload;
70+
public event EventHandler DomainUnload = null!;
7171

7272
public event EventHandler<FirstChanceExceptionEventArgs> FirstChanceException
7373
{
@@ -244,7 +244,7 @@ public event ResolveEventHandler AssemblyResolve
244244
remove { AssemblyLoadContext.AssemblyResolve -= value; }
245245
}
246246

247-
public event ResolveEventHandler ReflectionOnlyAssemblyResolve;
247+
public event ResolveEventHandler ReflectionOnlyAssemblyResolve = null!;
248248

249249
public event ResolveEventHandler TypeResolve
250250
{

‎src/System.Private.CoreLib/shared/System/Diagnostics/Tracing/EventSource.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4060,7 +4060,7 @@ public event EventHandler<EventSourceCreatedEventArgs> EventSourceCreated
40604060
/// This event is raised whenever an event has been written by a EventSource for which
40614061
/// the EventListener has enabled events.
40624062
/// </summary>
4063-
public event EventHandler<EventWrittenEventArgs> EventWritten;
4063+
public event EventHandler<EventWrittenEventArgs> EventWritten = null!;
40644064

40654065
static EventListener()
40664066
{

‎src/System.Private.CoreLib/shared/System/Progress.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public Progress(Action<T> handler) : this()
5656
/// Handlers registered with this event will be invoked on the
5757
/// <see cref="System.Threading.SynchronizationContext"/> captured when the instance was constructed.
5858
/// </remarks>
59-
public event EventHandler<T> ProgressChanged;
59+
public event EventHandler<T> ProgressChanged = null!;
6060

6161
/// <summary>Reports a progress change.</summary>
6262
/// <param name="value">The value of the updated progress.</param>

‎src/System.Private.CoreLib/shared/System/Runtime/Loader/AssemblyLoadContext.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ private enum InternalState
3838
// synchronization primitive to protect against usage of this instance while unloading
3939
private readonly object _unloadLock;
4040

41-
private event Func<Assembly, string, IntPtr> _resolvingUnmanagedDll;
41+
private event Func<Assembly, string, IntPtr> _resolvingUnmanagedDll = null!;
4242

43-
private event Func<AssemblyLoadContext, AssemblyName, Assembly> _resolving;
43+
private event Func<AssemblyLoadContext, AssemblyName, Assembly> _resolving = null!;
4444

45-
private event Action<AssemblyLoadContext> _unloading;
45+
private event Action<AssemblyLoadContext> _unloading = null!;
4646

4747
private readonly string? _name;
4848

0 commit comments

Comments
 (0)
This repository has been archived.