diff options
author | Stephen Toub <stoub@microsoft.com> | 2019-07-17 23:38:09 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2019-07-24 10:45:03 +0300 |
commit | f8d61819b87b8b653d6bde31ae74b7e49ab88bd7 (patch) | |
tree | 5a70235f1257be1d738eb0f25210acfc767ec1aa /netcore/System.Private.CoreLib/shared/System/Runtime/Loader/AssemblyLoadContext.cs | |
parent | 4ec5b8de9808b04929f63e6bed05125d197af4ff (diff) |
Make all event types nullable (dotnet/coreclr#25752)
Late-breaking design change: all events should be declared with nullable delegate types.
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Diffstat (limited to 'netcore/System.Private.CoreLib/shared/System/Runtime/Loader/AssemblyLoadContext.cs')
-rw-r--r-- | netcore/System.Private.CoreLib/shared/System/Runtime/Loader/AssemblyLoadContext.cs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/netcore/System.Private.CoreLib/shared/System/Runtime/Loader/AssemblyLoadContext.cs b/netcore/System.Private.CoreLib/shared/System/Runtime/Loader/AssemblyLoadContext.cs index 1c19e0971c5..84d81fe769a 100644 --- a/netcore/System.Private.CoreLib/shared/System/Runtime/Loader/AssemblyLoadContext.cs +++ b/netcore/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 = null!; + private event Func<Assembly, string, IntPtr>? _resolvingUnmanagedDll; - private event Func<AssemblyLoadContext, AssemblyName, Assembly> _resolving = null!; + private event Func<AssemblyLoadContext, AssemblyName, Assembly>? _resolving; - private event Action<AssemblyLoadContext> _unloading = null!; + private event Action<AssemblyLoadContext>? _unloading; private readonly string? _name; @@ -168,7 +168,7 @@ namespace System.Runtime.Loader // // Inputs: Invoking assembly, and library name to resolve // Returns: A handle to the loaded native library - public event Func<Assembly, string, IntPtr> ResolvingUnmanagedDll // TODO-NULLABLE: Should all events use nullable delegate types? + public event Func<Assembly, string, IntPtr>? ResolvingUnmanagedDll { add { @@ -186,7 +186,7 @@ namespace System.Runtime.Loader // // Inputs: The AssemblyLoadContext and AssemblyName to be loaded // Returns: The Loaded assembly object. - public event Func<AssemblyLoadContext, AssemblyName, Assembly?> Resolving // TODO-NULLABLE: Should all events use nullable delegate types? + public event Func<AssemblyLoadContext, AssemblyName, Assembly?>? Resolving { add { @@ -198,7 +198,7 @@ namespace System.Runtime.Loader } } - public event Action<AssemblyLoadContext> Unloading // TODO-NULLABLE: Should all events use nullable delegate types? + public event Action<AssemblyLoadContext>? Unloading { add { @@ -212,17 +212,17 @@ namespace System.Runtime.Loader #region AppDomainEvents // Occurs when an Assembly is loaded - internal static event AssemblyLoadEventHandler AssemblyLoad; // TODO-NULLABLE: Should all events use nullable delegate types? + internal static event AssemblyLoadEventHandler? AssemblyLoad; // Occurs when resolution of type fails - internal static event ResolveEventHandler TypeResolve; // TODO-NULLABLE: Should all events use nullable delegate types? + internal static event ResolveEventHandler? TypeResolve; // Occurs when resolution of resource fails - internal static event ResolveEventHandler ResourceResolve; // TODO-NULLABLE: Should all events use nullable delegate types? + internal static event ResolveEventHandler? ResourceResolve; // Occurs when resolution of assembly fails // This event is fired after resolve events of AssemblyLoadContext fails - internal static event ResolveEventHandler AssemblyResolve; // TODO-NULLABLE: Should all events use nullable delegate types? + internal static event ResolveEventHandler? AssemblyResolve; #endregion public static AssemblyLoadContext Default => DefaultAssemblyLoadContext.s_loadContext; |