Skip to content

Commit 6de7147

Browse files
authored
Enable IDE0059 analyzer: Unnecessary assignment of a value (#63340)
1 parent 635cfb3 commit 6de7147

File tree

505 files changed

+1164
-1740
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

505 files changed

+1164
-1740
lines changed

eng/CodeAnalysis.src.globalconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1444,7 +1444,7 @@ dotnet_diagnostic.IDE0057.severity = suggestion
14441444
dotnet_diagnostic.IDE0058.severity = silent
14451445

14461446
# IDE0059: Unnecessary assignment of a value
1447-
dotnet_diagnostic.IDE0059.severity = suggestion
1447+
dotnet_diagnostic.IDE0059.severity = warning
14481448

14491449
# IDE0060: Remove unused parameter
14501450
dotnet_diagnostic.IDE0060.severity = silent

src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.CoreRT.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,6 @@ private unsafe IntPtr AsRuntimeDefined(in Guid riid)
213213
{
214214
return (IntPtr)(Dispatches + i);
215215
}
216-
217-
i++;
218216
}
219217

220218
return IntPtr.Zero;

src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Thread.CoreRT.Windows.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,10 @@ private unsafe bool CreateThread(GCHandle thisThreadHandle)
200200
stackSize = AllocationGranularity;
201201
}
202202

203-
uint threadId;
204203
_osHandle = Interop.Kernel32.CreateThread(IntPtr.Zero, (IntPtr)stackSize,
205204
&ThreadEntryPoint, (IntPtr)thisThreadHandle,
206205
Interop.Kernel32.CREATE_SUSPENDED | Interop.Kernel32.STACK_SIZE_PARAM_IS_A_RESERVATION,
207-
out threadId);
206+
out _);
208207

209208
if (_osHandle.IsInvalid)
210209
{

src/coreclr/nativeaot/System.Private.Interop/src/Internal/Runtime/CompilerHelpers/RuntimeInteropData.CoreRT.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,9 @@ public override bool TryGetStructUnsafeStructSize(RuntimeTypeHandle structureTyp
4444

4545
public override bool TryGetStructFieldOffset(RuntimeTypeHandle structureTypeHandle, string fieldName, out bool structExists, out uint offset)
4646
{
47-
ExternalReferencesTable externalReferences;
4847
NativeParser entryParser;
4948
structExists = false;
50-
if (TryGetStructData(structureTypeHandle, out externalReferences, out entryParser))
49+
if (TryGetStructData(structureTypeHandle, out _, out entryParser))
5150
{
5251
structExists = true;
5352

src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/ActivatorImplementation.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ public static object CreateInstance(
8888
if (binder == null)
8989
binder = Type.DefaultBinder;
9090

91-
object state = null;
92-
MethodBase invokeMethod = binder.BindToMethod(bindingAttr, matches.ToArray(), ref args, null, culture, null, out state);
91+
MethodBase invokeMethod = binder.BindToMethod(bindingAttr, matches.ToArray(), ref args, null, culture, null, out object state);
9392
if (invokeMethod.GetParametersNoCopy().Length == 0)
9493
{
9594
if (args.Length != 0)

src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/Assemblies/NativeFormat/NativeFormatRuntimeAssembly.GetTypeCore.CaseInsensitive.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ private LowLevelDictionary<string, QHandle> CreateCaseInsensitiveTypeDictionary(
9999
foreach (TypeDefinitionHandle typeDefinitionHandle in namespaceDefinition.TypeDefinitions)
100100
{
101101
string fullName = ns + typeDefinitionHandle.GetTypeDefinition(reader).Name.GetString(reader).ToLowerInvariant();
102-
QHandle existingValue;
103-
if (!dict.TryGetValue(fullName, out existingValue))
102+
if (!dict.TryGetValue(fullName, out _))
104103
{
105104
dict.Add(fullName, new QHandle(reader, typeDefinitionHandle));
106105
}
@@ -109,8 +108,7 @@ private LowLevelDictionary<string, QHandle> CreateCaseInsensitiveTypeDictionary(
109108
foreach (TypeForwarderHandle typeForwarderHandle in namespaceDefinition.TypeForwarders)
110109
{
111110
string fullName = ns + typeForwarderHandle.GetTypeForwarder(reader).Name.GetString(reader).ToLowerInvariant();
112-
QHandle existingValue;
113-
if (!dict.TryGetValue(fullName, out existingValue))
111+
if (!dict.TryGetValue(fullName, out _))
114112
{
115113
dict.Add(fullName, new QHandle(reader, typeForwarderHandle));
116114
}

src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/BindingFlagSupport/Shared.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,9 @@ public static bool QualifiesBasedOnParameterCount(this MethodBase methodBase, Bi
149149
public static M GetImplicitlyOverriddenBaseClassMember<M>(this M member) where M : MemberInfo
150150
{
151151
MemberPolicies<M> policies = MemberPolicies<M>.Default;
152-
MethodAttributes visibility;
153-
bool isStatic;
154152
bool isVirtual;
155153
bool isNewSlot;
156-
policies.GetMemberAttributes(member, out visibility, out isStatic, out isVirtual, out isNewSlot);
154+
policies.GetMemberAttributes(member, out _, out _, out isVirtual, out isNewSlot);
157155
if (isNewSlot || !isVirtual)
158156
{
159157
return null;
@@ -174,11 +172,8 @@ public static M GetImplicitlyOverriddenBaseClassMember<M>(this M member) where M
174172
{
175173
continue;
176174
}
177-
MethodAttributes candidateVisibility;
178-
bool isCandidateStatic;
179175
bool isCandidateVirtual;
180-
bool isCandidateNewSlot;
181-
policies.GetMemberAttributes(member, out candidateVisibility, out isCandidateStatic, out isCandidateVirtual, out isCandidateNewSlot);
176+
policies.GetMemberAttributes(member, out _, out _, out isCandidateVirtual, out _);
182177
if (!isCandidateVirtual)
183178
{
184179
continue;

src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/CustomAttributes/RuntimeCustomAttributeData.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,10 @@ private static string ComputeTypedArgumentString(CustomAttributeTypedArgument ca
146146

147147
else if (argumentType.IsArray)
148148
{
149-
string result = null;
150149
IList<CustomAttributeTypedArgument> array = value as IList<CustomAttributeTypedArgument>;
151150

152151
Type elementType = argumentType.GetElementType();
153-
result = string.Format(@"new {0}[{1}] {{ ", elementType.IsEnum ? elementType.FullName : elementType.Name, array.Count);
152+
string result = string.Format(@"new {0}[{1}] {{ ", elementType.IsEnum ? elementType.FullName : elementType.Name, array.Count);
154153

155154
for (int i = 0; i < array.Count; i++)
156155
result += string.Format(i == 0 ? "{0}" : ", {0}", ComputeTypedArgumentString(array[i], elementType != typeof(object)));

src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/General/NamespaceChain.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ internal NamespaceChain(MetadataReader reader, NamespaceDefinitionHandle innerMo
2121
{
2222
NamespaceDefinition currentNamespaceDefinition = innerMostNamespaceHandle.GetNamespaceDefinition(reader);
2323
ConstantStringValueHandle currentNameHandle = currentNamespaceDefinition.Name;
24-
Handle currentNamespaceHandle = innerMostNamespaceHandle.ToHandle(reader);
24+
Handle currentNamespaceHandle;
2525
LowLevelList<string> names = new LowLevelList<string>();
2626
for (;;)
2727
{

src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/General/ReflectionCoreCallbacksImplementation.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ private FieldInfo GetFieldInfo(RuntimeTypeHandle declaringTypeHandle, FieldHandl
164164
{
165165
RuntimeTypeInfo contextTypeInfo = declaringTypeHandle.GetTypeForRuntimeTypeHandle();
166166
NativeFormatRuntimeNamedTypeInfo definingTypeInfo = contextTypeInfo.AnchoringTypeDefinitionForDeclaredMembers.CastToNativeFormatRuntimeNamedTypeInfo();
167-
MetadataReader reader = definingTypeInfo.Reader;
168167

169168
// RuntimeFieldHandles always yield FieldInfo's whose ReflectedType equals the DeclaringType.
170169
RuntimeTypeInfo reflectedType = contextTypeInfo;

src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/MethodInfos/RuntimePlainConstructorInfo.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,7 @@ protected sealed override RuntimeParameterInfo[] RuntimeParameters
178178
{
179179
get
180180
{
181-
RuntimeParameterInfo ignore;
182-
return _lazyParameters ?? (_lazyParameters = RuntimeMethodHelpers.GetRuntimeParameters(ref _common, this, Array.Empty<RuntimeTypeInfo>(), out ignore));
181+
return _lazyParameters ??= RuntimeMethodHelpers.GetRuntimeParameters(ref _common, this, Array.Empty<RuntimeTypeInfo>(), out _);
183182
}
184183
}
185184

src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/ParameterInfos/RuntimeFatMethodParameterInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public sealed override object RawDefaultValue
5050
if (rawDefaultValueInfo == null)
5151
{
5252
object rawDefaultValue;
53-
bool dontCare = GetDefaultValueOrSentinel(raw: true, defaultValue: out rawDefaultValue);
53+
GetDefaultValueOrSentinel(raw: true, defaultValue: out rawDefaultValue);
5454
rawDefaultValueInfo = _lazyRawDefaultValueInfo = Tuple.Create(rawDefaultValue);
5555
}
5656
return rawDefaultValueInfo.Item1;

src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/TypeInfos/RuntimeTypeInfo.InvokeMember.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ public sealed override object InvokeMember(
7575
if (binder == null)
7676
binder = DefaultBinder;
7777

78-
bool bDefaultBinder = (binder == DefaultBinder);
7978
#endregion
8079

8180
#region Delegate to Activator.CreateInstance
@@ -320,7 +319,7 @@ public sealed override object InvokeMember(
320319

321320
for (int i = 0; i < semiFinalists.Length; i++)
322321
{
323-
MethodInfo semiFinalist = null;
322+
MethodInfo semiFinalist;
324323

325324
if (isSetProperty)
326325
{

src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.MappingTables.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,8 +1038,8 @@ private static FunctionPointersToOffsets ComputeLdftnReverseLookup_InvokeMap(Nat
10381038
if (!hasEntrypoint)
10391039
continue;
10401040

1041-
uint entryMethodHandleOrNameAndSigRaw = entryParser.GetUnsigned();
1042-
uint entryDeclaringTypeRaw = entryParser.GetUnsigned();
1041+
entryParser.SkipInteger(); // entryMethodHandleOrNameAndSigRaw
1042+
entryParser.SkipInteger(); // entryDeclaringTypeRaw
10431043

10441044
IntPtr entryMethodEntrypoint = externalReferences.GetFunctionPointerFromIndex(entryParser.GetUnsigned());
10451045
functionPointers.Add(new FunctionPointerOffsetPair(entryMethodEntrypoint, parserOffset));
@@ -1401,16 +1401,14 @@ public unsafe sealed override bool TryGetMethodFromHandle(RuntimeMethodHandle ru
14011401
//
14021402
public sealed override bool TryGetMethodFromHandleAndType(RuntimeMethodHandle runtimeMethodHandle, RuntimeTypeHandle declaringTypeHandle, out QMethodDefinition methodHandle, out RuntimeTypeHandle[] genericMethodTypeArgumentHandles)
14031403
{
1404-
RuntimeTypeHandle dummy;
1405-
return TryGetMethodFromHandle(runtimeMethodHandle, out dummy, out methodHandle, out genericMethodTypeArgumentHandles);
1404+
return TryGetMethodFromHandle(runtimeMethodHandle, out _, out methodHandle, out genericMethodTypeArgumentHandles);
14061405
}
14071406

14081407
//
14091408
// This resolves RuntimeFieldHandles for fields declared on non-generic types (declaringTypeHandle is an output of this method.)
14101409
//
14111410
public unsafe sealed override bool TryGetFieldFromHandle(RuntimeFieldHandle runtimeFieldHandle, out RuntimeTypeHandle declaringTypeHandle, out FieldHandle fieldHandle)
14121411
{
1413-
declaringTypeHandle = default(RuntimeTypeHandle);
14141412
fieldHandle = default(FieldHandle);
14151413

14161414
string fieldName;
@@ -1446,8 +1444,7 @@ public unsafe sealed override bool TryGetFieldFromHandle(RuntimeFieldHandle runt
14461444
//
14471445
public sealed override bool TryGetFieldFromHandleAndType(RuntimeFieldHandle runtimeFieldHandle, RuntimeTypeHandle declaringTypeHandle, out FieldHandle fieldHandle)
14481446
{
1449-
RuntimeTypeHandle dummy;
1450-
return TryGetFieldFromHandle(runtimeFieldHandle, out dummy, out fieldHandle);
1447+
return TryGetFieldFromHandle(runtimeFieldHandle, out _, out fieldHandle);
14511448
}
14521449

14531450
/// <summary>

src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/PayForPlayExperience/DiagnosticMappingTables.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,8 @@ public static bool TryGetDiagnosticStringForNamedType(RuntimeTypeHandle runtimeT
6262

6363
private static string GetTypeFullNameFromTypeRef(TypeReferenceHandle typeReferenceHandle, MetadataReader reader, List<int> genericParameterOffsets)
6464
{
65-
string s = "";
66-
6765
TypeReference typeReference = typeReferenceHandle.GetTypeReference(reader);
68-
s = typeReference.TypeName.GetString(reader);
66+
string s = typeReference.TypeName.GetString(reader);
6967
Handle parentHandle = typeReference.ParentNamespaceOrType;
7068
HandleType parentHandleType = parentHandle.HandleType;
7169
if (parentHandleType == HandleType.TypeReference)
@@ -135,7 +133,7 @@ public static string ConvertBackTickNameToNameWithReducerInputFormat(string type
135133

136134
private static string GetTypeFullNameFromTypeDef(TypeDefinitionHandle typeDefinitionHandle, MetadataReader reader, List<int> genericParameterOffsets)
137135
{
138-
string s = "";
136+
string s;
139137

140138
TypeDefinition typeDefinition = typeDefinitionHandle.GetTypeDefinition(reader);
141139
s = typeDefinition.Name.GetString(reader);

src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/PayForPlayExperience/MissingMetadataExceptionCreator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public static string ComputeUsefulPertainantIfPossible(object pertainant)
109109
if (pertainant is MethodBase)
110110
{
111111
MethodBase method = (MethodBase)pertainant;
112-
bool first = true;
112+
bool first;
113113

114114
// write out generic parameters
115115
if (method.IsConstructedGenericMethod)

src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/CallConverterThunk.CallConversionParameters.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -341,10 +341,8 @@ internal void PrepareNextMulticastDelegateCall(int currentIndex)
341341
Delegate[] delegateArray = (Delegate[])_delegateData._helperObject;
342342
Delegate currentDelegate = delegateArray[currentIndex];
343343

344-
object helperObject;
345-
IntPtr extraFunctionPointerOrData;
346344
IntPtr functionPointer;
347-
RuntimeAugments.GetDelegateData(currentDelegate, out _delegateData._multicastThisPointer, out helperObject, out extraFunctionPointerOrData, out functionPointer);
345+
RuntimeAugments.GetDelegateData(currentDelegate, out _delegateData._multicastThisPointer, out _, out _, out functionPointer);
348346

349347
bool forceCalleeHasParamType = UpdateCalleeFunctionPointer(functionPointer);
350348
_calleeArgs.SetHasParamTypeAndReset(forceCalleeHasParamType);

src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/CallConverterThunk.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,7 @@ public static unsafe IntPtr GetDelegateThunk(Delegate delegateObject, int thunkK
259259
Debug.Assert(RuntimeAugments.IsGenericType(delegateType));
260260

261261
RuntimeTypeHandle[] typeArgs;
262-
RuntimeTypeHandle genericTypeDefHandle;
263-
genericTypeDefHandle = RuntimeAugments.GetGenericInstantiation(delegateType, out typeArgs);
262+
RuntimeAugments.GetGenericInstantiation(delegateType, out typeArgs);
264263
Debug.Assert(typeArgs != null && typeArgs.Length > 0);
265264

266265
RuntimeSignature invokeMethodSignature;
@@ -303,9 +302,8 @@ public static unsafe IntPtr GetDelegateThunk(Delegate delegateObject, int thunkK
303302
public static unsafe bool TryGetNonUnboxingFunctionPointerFromUnboxingAndInstantiatingStub(IntPtr potentialStub, RuntimeTypeHandle exactType, out IntPtr nonUnboxingMethod)
304303
{
305304
IntPtr callConversionId;
306-
IntPtr commonStubDataPtr;
307305
object thunkPoolHeap = s_thunkPoolHeap;
308-
if (thunkPoolHeap == null || !RuntimeAugments.TryGetThunkData(thunkPoolHeap, potentialStub, out callConversionId, out commonStubDataPtr))
306+
if (thunkPoolHeap == null || !RuntimeAugments.TryGetThunkData(thunkPoolHeap, potentialStub, out callConversionId, out _))
309307
{
310308
// This isn't a call conversion stub
311309
nonUnboxingMethod = IntPtr.Zero;
@@ -383,9 +381,8 @@ public static unsafe bool TryGetCallConversionTargetPointerAndInstantiatingArg(I
383381
methodTarget = instantiatingArg = IntPtr.Zero;
384382

385383
IntPtr callConversionId;
386-
IntPtr commonStubDataPtr;
387384
object thunkPoolHeap = s_thunkPoolHeap;
388-
if (thunkPoolHeap == null || !RuntimeAugments.TryGetThunkData(thunkPoolHeap, potentialStub, out callConversionId, out commonStubDataPtr))
385+
if (thunkPoolHeap == null || !RuntimeAugments.TryGetThunkData(thunkPoolHeap, potentialStub, out callConversionId, out _))
389386
{
390387
// This isn't a call conversion stub
391388
return false;

src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/CallingConventions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ public static bool TypeUsesReturnBuffer(RuntimeTypeHandle returnType, bool metho
6767
CorElementType typeReturnType = thReturnType.GetCorElementType();
6868

6969
bool usesReturnBuffer;
70-
uint fpReturnSizeIgnored;
71-
ArgIterator.ComputeReturnValueTreatment(typeReturnType, thReturnType, methodWithReturnTypeIsVarArg, out usesReturnBuffer, out fpReturnSizeIgnored);
70+
ArgIterator.ComputeReturnValueTreatment(typeReturnType, thReturnType, methodWithReturnTypeIsVarArg, out usesReturnBuffer, out _);
7271

7372
return usesReturnBuffer;
7473
}

src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/EETypeCreator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,7 @@ public static RuntimeTypeHandle CreateEEType(TypeDesc type, TypeBuilderState sta
10451045
{
10461046
Debug.Assert(type != null && state != null);
10471047

1048-
MethodTable* pTemplateEEType = null;
1048+
MethodTable* pTemplateEEType;
10491049
bool requireVtableSlotMapping = false;
10501050

10511051
if (type is PointerType || type is ByRefType)

src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/ModuleList.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -673,8 +673,7 @@ public void RegisterNewModules(ModuleType moduleType)
673673
foreach (TypeManagerHandle moduleHandle in loadedModuleHandles)
674674
{
675675
// Skip already registered modules.
676-
int oldModuleIndex;
677-
if (_loadedModuleMap.HandleToModuleIndex.TryGetValue(moduleHandle, out oldModuleIndex))
676+
if (_loadedModuleMap.HandleToModuleIndex.TryGetValue(moduleHandle, out _))
678677
{
679678
continue;
680679
}

src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/NativeLayoutFieldAlgorithm.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,7 @@ private static void EnsureFieldLayoutLoadedForNonUniversalType(DefType type)
234234
// Look up the universal template for this type. Only the universal template has field layout
235235
// information, so we have to use it to parse the field layout.
236236
NativeLayoutInfoLoadContext universalLayoutLoadContext;
237-
NativeLayoutInfo universalLayoutInfo;
238-
NativeParser typeInfoParser = type.GetOrCreateTypeBuilderState().GetParserForUniversalNativeLayoutInfo(out universalLayoutLoadContext, out universalLayoutInfo);
237+
NativeParser typeInfoParser = type.GetOrCreateTypeBuilderState().GetParserForUniversalNativeLayoutInfo(out universalLayoutLoadContext, out _);
239238

240239
if (typeInfoParser.IsNull)
241240
throw new TypeBuilder.MissingTemplateException();

src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/NativeLayoutInfoLoadContext.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ internal MethodDesc GetMethod(ref NativeParser parser, out RuntimeSignature meth
173173

174174
bool unboxingStub = (flags & MethodFlags.IsUnboxingStub) != 0;
175175

176-
MethodDesc retVal = null;
176+
MethodDesc retVal;
177177
if ((flags & MethodFlags.HasInstantiation) != 0)
178178
{
179179
TypeDesc[] typeArguments = GetTypeSequence(ref parser);
@@ -197,9 +197,7 @@ internal MethodDesc GetMethod(ref NativeParser parser, out RuntimeSignature meth
197197

198198
internal MethodDesc GetMethod(ref NativeParser parser)
199199
{
200-
RuntimeSignature methodSig;
201-
RuntimeSignature methodNameSig;
202-
return GetMethod(ref parser, out methodNameSig, out methodSig);
200+
return GetMethod(ref parser, out _, out _);
203201
}
204202

205203
internal TypeDesc[] GetTypeSequence(ref NativeParser parser)

src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TemplateLocator.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,7 @@ private InstantiatedMethod TryGetGenericMethodTemplate_Internal(InstantiatedMeth
236236
if (nativeLayoutReader == null)
237237
continue;
238238

239-
ExternalReferencesTable externalFixupsTable;
240-
NativeHashtable genericMethodTemplatesHashtable = LoadHashtable(moduleInfo, ReflectionMapBlob.GenericMethodsTemplateMap, out externalFixupsTable);
239+
NativeHashtable genericMethodTemplatesHashtable = LoadHashtable(moduleInfo, ReflectionMapBlob.GenericMethodsTemplateMap, out _);
241240

242241
if (genericMethodTemplatesHashtable.IsNull)
243242
continue;

0 commit comments

Comments
 (0)