summaryrefslogtreecommitdiff
path: root/src/System.Private.CoreLib
diff options
context:
space:
mode:
authorSantiago Fernandez Madero <safern@microsoft.com>2019-07-16 17:22:54 -0700
committerStephen Toub <stoub@microsoft.com>2019-07-18 14:25:53 -0400
commit3c0368e2854e969c20e96984d9978f3d7f7a18a2 (patch)
tree6febd68a9836317d4fadf7dc11f30fcf92825eb5 /src/System.Private.CoreLib
parent57a30905e160ad341b959cfbb08befc6a5a3d7dd (diff)
downloadcoreclr-3c0368e2854e969c20e96984d9978f3d7f7a18a2.tar.gz
coreclr-3c0368e2854e969c20e96984d9978f3d7f7a18a2.tar.bz2
coreclr-3c0368e2854e969c20e96984d9978f3d7f7a18a2.zip
Fix nullability warnings from compiler update
Diffstat (limited to 'src/System.Private.CoreLib')
-rw-r--r--src/System.Private.CoreLib/shared/System/AppDomain.cs6
-rw-r--r--src/System.Private.CoreLib/shared/System/Diagnostics/Tracing/EventSource.cs2
-rw-r--r--src/System.Private.CoreLib/shared/System/Progress.cs2
-rw-r--r--src/System.Private.CoreLib/shared/System/Runtime/Loader/AssemblyLoadContext.cs6
4 files changed, 8 insertions, 8 deletions
diff --git a/src/System.Private.CoreLib/shared/System/AppDomain.cs b/src/System.Private.CoreLib/shared/System/AppDomain.cs
index 88856a599c..d48d34922f 100644
--- a/src/System.Private.CoreLib/shared/System/AppDomain.cs
+++ b/src/System.Private.CoreLib/shared/System/AppDomain.cs
@@ -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;
@@ -67,7 +67,7 @@ namespace System
public bool IsHomogenous => true;
- public event EventHandler DomainUnload;
+ public event EventHandler DomainUnload = null!;
public event EventHandler<FirstChanceExceptionEventArgs> FirstChanceException
{
@@ -244,7 +244,7 @@ namespace System
remove { AssemblyLoadContext.AssemblyResolve -= value; }
}
- public event ResolveEventHandler ReflectionOnlyAssemblyResolve;
+ public event ResolveEventHandler ReflectionOnlyAssemblyResolve = null!;
public event ResolveEventHandler TypeResolve
{
diff --git a/src/System.Private.CoreLib/shared/System/Diagnostics/Tracing/EventSource.cs b/src/System.Private.CoreLib/shared/System/Diagnostics/Tracing/EventSource.cs
index bf25248d94..b7492347a8 100644
--- a/src/System.Private.CoreLib/shared/System/Diagnostics/Tracing/EventSource.cs
+++ b/src/System.Private.CoreLib/shared/System/Diagnostics/Tracing/EventSource.cs
@@ -4060,7 +4060,7 @@ namespace System.Diagnostics.Tracing
/// 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()
{
diff --git a/src/System.Private.CoreLib/shared/System/Progress.cs b/src/System.Private.CoreLib/shared/System/Progress.cs
index f29849378b..12557da4e9 100644
--- a/src/System.Private.CoreLib/shared/System/Progress.cs
+++ b/src/System.Private.CoreLib/shared/System/Progress.cs
@@ -56,7 +56,7 @@ namespace System
/// 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>
diff --git a/src/System.Private.CoreLib/shared/System/Runtime/Loader/AssemblyLoadContext.cs b/src/System.Private.CoreLib/shared/System/Runtime/Loader/AssemblyLoadContext.cs
index 1210987fb4..c952686276 100644
--- a/src/System.Private.CoreLib/shared/System/Runtime/Loader/AssemblyLoadContext.cs
+++ b/src/System.Private.CoreLib/shared/System/Runtime/Loader/AssemblyLoadContext.cs
@@ -38,11 +38,11 @@ namespace System.Runtime.Loader
// 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;