diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-04-12 19:56:52 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-04-12 19:56:52 -0400 |
commit | c3851ae2e6c8fb286d4744612fbfea039d1baf7f (patch) | |
tree | 9680fbed073c6c792c5c55d18632f8351099b508 /src/SMAPI.Internal.Patching/PatchHelper.cs | |
parent | 4e0e928c943bc2d5f1bec27c117a648f55ab5894 (diff) | |
download | SMAPI-c3851ae2e6c8fb286d4744612fbfea039d1baf7f.tar.gz SMAPI-c3851ae2e6c8fb286d4744612fbfea039d1baf7f.tar.bz2 SMAPI-c3851ae2e6c8fb286d4744612fbfea039d1baf7f.zip |
enable nullable annotations in shared projects (#837)
Diffstat (limited to 'src/SMAPI.Internal.Patching/PatchHelper.cs')
-rw-r--r-- | src/SMAPI.Internal.Patching/PatchHelper.cs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/SMAPI.Internal.Patching/PatchHelper.cs b/src/SMAPI.Internal.Patching/PatchHelper.cs index 52b15fd1..edd8ef57 100644 --- a/src/SMAPI.Internal.Patching/PatchHelper.cs +++ b/src/SMAPI.Internal.Patching/PatchHelper.cs @@ -1,5 +1,3 @@ -#nullable disable - using System; using System.Linq; using System.Reflection; @@ -18,7 +16,7 @@ namespace StardewModdingAPI.Internal.Patching /// <typeparam name="TTarget">The type containing the method.</typeparam> /// <param name="parameters">The method parameter types, or <c>null</c> if it's not overloaded.</param> /// <exception cref="InvalidOperationException">The type has no matching constructor.</exception> - public static ConstructorInfo RequireConstructor<TTarget>(Type[] parameters = null) + public static ConstructorInfo RequireConstructor<TTarget>(Type[]? parameters = null) { return AccessTools.Constructor(typeof(TTarget), parameters) @@ -31,7 +29,7 @@ namespace StardewModdingAPI.Internal.Patching /// <param name="parameters">The method parameter types, or <c>null</c> if it's not overloaded.</param> /// <param name="generics">The method generic types, or <c>null</c> if it's not generic.</param> /// <exception cref="InvalidOperationException">The type has no matching method.</exception> - public static MethodInfo RequireMethod<TTarget>(string name, Type[] parameters = null, Type[] generics = null) + public static MethodInfo RequireMethod<TTarget>(string name, Type[]? parameters = null, Type[]? generics = null) { return AccessTools.Method(typeof(TTarget), name, parameters, generics) @@ -43,7 +41,7 @@ namespace StardewModdingAPI.Internal.Patching /// <param name="name">The method name, or <c>null</c> for a constructor.</param> /// <param name="parameters">The method parameter types, or <c>null</c> if it's not overloaded.</param> /// <param name="generics">The method generic types, or <c>null</c> if it's not generic.</param> - public static string GetMethodString(Type type, string name, Type[] parameters = null, Type[] generics = null) + public static string GetMethodString(Type type, string? name, Type[]? parameters = null, Type[]? generics = null) { StringBuilder str = new(); |