diff --git a/src/System.Private.CoreLib/src/System/Decimal.cs b/src/System.Private.CoreLib/src/System/Decimal.cs index e9498a52941..a868c7583bb 100644 --- a/src/System.Private.CoreLib/src/System/Decimal.cs +++ b/src/System.Private.CoreLib/src/System/Decimal.cs @@ -544,7 +544,7 @@ public static Decimal Parse(String s, NumberStyles style, IFormatProvider provid return Number.ParseDecimal(s, style, NumberFormatInfo.GetInstance(provider)); } - public static Decimal Parse(ReadOnlySpan s, NumberStyles style, IFormatProvider provider) + public static Decimal Parse(ReadOnlySpan s, NumberStyles style = NumberStyles.Integer, IFormatProvider provider = null) { ValidateParseStyleFloatingPoint(style); return Number.ParseDecimal(s, style, NumberFormatInfo.GetInstance(provider)); diff --git a/src/System.Private.CoreLib/src/System/Delegate.cs b/src/System.Private.CoreLib/src/System/Delegate.cs index 0ec444eaa55..e4746b1abdf 100644 --- a/src/System.Private.CoreLib/src/System/Delegate.cs +++ b/src/System.Private.CoreLib/src/System/Delegate.cs @@ -493,21 +493,21 @@ private bool TrySetSlot(Delegate[] a, int index, Delegate o) // This method will combine this delegate with the passed delegate // to form a new delegate. - protected virtual Delegate CombineImpl(Delegate follow) + protected virtual Delegate CombineImpl(Delegate d) { - if ((Object)follow == null) // cast to object for a more efficient test + if ((Object)d == null) // cast to object for a more efficient test return this; // Verify that the types are the same... - if (!InternalEqualTypes(this, follow)) + if (!InternalEqualTypes(this, d)) throw new ArgumentException(); - if (IsDynamicDelegate() && follow.IsDynamicDelegate()) + if (IsDynamicDelegate() && d.IsDynamicDelegate()) { throw new InvalidOperationException(); } - MulticastDelegate dFollow = (MulticastDelegate)follow; + MulticastDelegate dFollow = (MulticastDelegate)d; Delegate[] resultList; int followCount = 1; Delegate[] followList = dFollow.m_helperObject as Delegate[]; @@ -616,12 +616,12 @@ private bool EqualInvocationLists(Delegate[] a, Delegate[] b, int start, int cou // look at the invocation list.) If this is found we remove it from // this list and return a new delegate. If its not found a copy of the // current list is returned. - protected virtual Delegate RemoveImpl(Delegate value) + protected virtual Delegate RemoveImpl(Delegate d) { // There is a special case were we are removing using a delegate as // the value we need to check for this case // - MulticastDelegate v = value as MulticastDelegate; + MulticastDelegate v = d as MulticastDelegate; if (v == null) return this; @@ -631,7 +631,7 @@ protected virtual Delegate RemoveImpl(Delegate value) if (invocationList == null) { // they are both not real Multicast - if (this.Equals(value)) + if (this.Equals(d)) return null; } else @@ -639,7 +639,7 @@ protected virtual Delegate RemoveImpl(Delegate value) int invocationCount = (int)m_extraFunctionPointerOrData; for (int i = invocationCount; --i >= 0;) { - if (value.Equals(invocationList[i])) + if (d.Equals(invocationList[i])) { if (invocationCount == 2) { diff --git a/src/System.Private.CoreLib/src/System/Enum.cs b/src/System.Private.CoreLib/src/System/Enum.cs index e863605c97d..06da1b11745 100644 --- a/src/System.Private.CoreLib/src/System/Enum.cs +++ b/src/System.Private.CoreLib/src/System/Enum.cs @@ -833,6 +833,7 @@ public String ToString(String format) return Format(enumInfo, this, format); } + [Obsolete("The provider argument is not used. Please use ToString().")] public String ToString(String format, IFormatProvider provider) { return ToString(format); diff --git a/src/System.Private.CoreLib/src/System/GC.cs b/src/System.Private.CoreLib/src/System/GC.cs index 053785d7507..68d1bc9a344 100644 --- a/src/System.Private.CoreLib/src/System/GC.cs +++ b/src/System.Private.CoreLib/src/System/GC.cs @@ -75,23 +75,23 @@ public static int GetGeneration(Object obj) /// Returns the current generation number of the target /// of a specified . /// - /// The WeakReference whose target is the object + /// The WeakReference whose target is the object /// whose generation will be returned /// The generation of the target of the WeakReference /// The target of the weak reference /// has already been garbage collected. - public static int GetGeneration(WeakReference wr) + public static int GetGeneration(WeakReference wo) { // note - this throws an NRE if given a null weak reference. This isn't // documented, but it's the behavior of Desktop and CoreCLR. - Object handleRef = RuntimeImports.RhHandleGet(wr.m_handle); + Object handleRef = RuntimeImports.RhHandleGet(wo.m_handle); if (handleRef == null) { - throw new ArgumentNullException(nameof(wr)); + throw new ArgumentNullException(nameof(wo)); } int result = RuntimeImports.RhGetGeneration(handleRef); - KeepAlive(wr); + KeepAlive(wo); return result; } diff --git a/src/System.Private.CoreLib/src/System/MissingFieldException.cs b/src/System.Private.CoreLib/src/System/MissingFieldException.cs index 95d517ccadb..88cd41c6adb 100644 --- a/src/System.Private.CoreLib/src/System/MissingFieldException.cs +++ b/src/System.Private.CoreLib/src/System/MissingFieldException.cs @@ -35,10 +35,10 @@ public MissingFieldException(String message, Exception inner) HResult = HResults.COR_E_MISSINGFIELD; } - public MissingFieldException(string className, string methodName) + public MissingFieldException(string className, string fieldName) { ClassName = className; - MemberName = methodName; + MemberName = fieldName; } protected MissingFieldException(SerializationInfo info, StreamingContext context) diff --git a/src/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs b/src/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs index d5c425a3ba6..601f34698c7 100644 --- a/src/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs +++ b/src/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs @@ -65,23 +65,23 @@ public static Object GetObjectValue(Object obj) return RuntimeImports.RhMemberwiseClone(obj); } - public new static bool Equals(Object obj1, Object obj2) + public new static bool Equals(Object o1, Object o2) { - if (obj1 == obj2) + if (o1 == o2) return true; - if ((obj1 == null) || (obj2 == null)) + if ((o1 == null) || (o2 == null)) return false; // If it's not a value class, don't compare by value - if (!obj1.EETypePtr.IsValueType) + if (!o1.EETypePtr.IsValueType) return false; // Make sure they are the same type. - if (obj1.EETypePtr != obj2.EETypePtr) + if (o1.EETypePtr != o2.EETypePtr) return false; - return RuntimeImports.RhCompareObjectContentsAndPadding(obj1, obj2); + return RuntimeImports.RhCompareObjectContentsAndPadding(o1, o2); } #if !FEATURE_SYNCTABLE diff --git a/src/System.Private.CoreLib/src/System/RuntimeArgumentHandle.cs b/src/System.Private.CoreLib/src/System/RuntimeArgumentHandle.cs index 917ef82d917..2a95e2d2542 100644 --- a/src/System.Private.CoreLib/src/System/RuntimeArgumentHandle.cs +++ b/src/System.Private.CoreLib/src/System/RuntimeArgumentHandle.cs @@ -7,7 +7,7 @@ namespace System { [StructLayout(LayoutKind.Sequential)] - public struct RuntimeArgumentHandle + public ref struct RuntimeArgumentHandle { } }