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

Commit

Permalink
Fix nullability warnings from compiler update
Browse files Browse the repository at this point in the history
  • Loading branch information
safern authored and stephentoub committed Jul 17, 2019
1 parent 04a7796 commit dbc0e19
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/System.Private.CoreLib/shared/System/AppDomain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +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.

#pragma warning disable CS0067 // events are declared but not used
#pragma warning disable CS0414 // events are assigned but not used

using System.Diagnostics;
using System.IO;
Expand Down Expand Up @@ -67,7 +67,7 @@ public string FriendlyName

public bool IsHomogenous => true;

public event EventHandler DomainUnload;
public event EventHandler DomainUnload = null!;

public event EventHandler<FirstChanceExceptionEventArgs> FirstChanceException
{
Expand Down Expand Up @@ -244,7 +244,7 @@ public event ResolveEventHandler AssemblyResolve
remove { AssemblyLoadContext.AssemblyResolve -= value; }
}

public event ResolveEventHandler ReflectionOnlyAssemblyResolve;
public event ResolveEventHandler ReflectionOnlyAssemblyResolve = null!;

public event ResolveEventHandler TypeResolve
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4060,7 +4060,7 @@ public event EventHandler<EventSourceCreatedEventArgs> EventSourceCreated
/// This event is raised whenever an event has been written by a EventSource for which
/// the EventListener has enabled events.
/// </summary>
public event EventHandler<EventWrittenEventArgs> EventWritten;
public event EventHandler<EventWrittenEventArgs> EventWritten = null!;

static EventListener()
{
Expand Down
2 changes: 1 addition & 1 deletion src/System.Private.CoreLib/shared/System/Progress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public Progress(Action<T> handler) : this()
/// Handlers registered with this event will be invoked on the
/// <see cref="System.Threading.SynchronizationContext"/> captured when the instance was constructed.
/// </remarks>
public event EventHandler<T> ProgressChanged;
public event EventHandler<T> ProgressChanged = null!;

/// <summary>Reports a progress change.</summary>
/// <param name="value">The value of the updated progress.</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ private enum InternalState
// synchronization primitive to protect against usage of this instance while unloading
private readonly object _unloadLock;

private event Func<Assembly, string, IntPtr> _resolvingUnmanagedDll;
private event Func<Assembly, string, IntPtr> _resolvingUnmanagedDll = null!;

private event Func<AssemblyLoadContext, AssemblyName, Assembly> _resolving;
private event Func<AssemblyLoadContext, AssemblyName, Assembly> _resolving = null!;

private event Action<AssemblyLoadContext> _unloading;
private event Action<AssemblyLoadContext> _unloading = null!;

private readonly string? _name;

Expand Down

0 comments on commit dbc0e19

Please sign in to comment.