From 291e410174e3d79a9b7b2cff77a2ee9017178d9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Petryka?= Date: Sun, 21 Jun 2026 00:41:19 +0200 Subject: [PATCH 1/8] Fix RemoveImpl nullability --- .../src/System/MulticastDelegate.CoreCLR.cs | 2 +- .../nativeaot/System.Private.CoreLib/src/System/Delegate.cs | 2 +- src/libraries/System.Runtime/ref/System.Runtime.cs | 2 +- .../System.Private.CoreLib/src/System/MulticastDelegate.Mono.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/coreclr/System.Private.CoreLib/src/System/MulticastDelegate.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/MulticastDelegate.CoreCLR.cs index 38fd1f5189f6ec..f870126adbeb4f 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/MulticastDelegate.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/MulticastDelegate.CoreCLR.cs @@ -290,7 +290,7 @@ private static bool EqualInvocationLists(object[] a, object[] b, int start, int // 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 sealed override Delegate? RemoveImpl(Delegate value) + protected sealed override Delegate? RemoveImpl(Delegate? value) { // There is a special case were we are removing using a delegate as // the value we need to check for this case diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Delegate.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Delegate.cs index 9968de32d01574..6e0b34b188301b 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Delegate.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Delegate.cs @@ -602,7 +602,7 @@ private static bool EqualInvocationLists(Wrapper[] a, Wrapper[] b, int start, in // 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 d) + 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 diff --git a/src/libraries/System.Runtime/ref/System.Runtime.cs b/src/libraries/System.Runtime/ref/System.Runtime.cs index a5ba94532bf8e5..2ab1d0c207763d 100644 --- a/src/libraries/System.Runtime/ref/System.Runtime.cs +++ b/src/libraries/System.Runtime/ref/System.Runtime.cs @@ -2370,7 +2370,7 @@ public virtual void GetObjectData(System.Runtime.Serialization.SerializationInfo public static bool operator !=(System.Delegate? d1, System.Delegate? d2) { throw null; } public static System.Delegate? Remove(System.Delegate? source, System.Delegate? value) { throw null; } public static System.Delegate? RemoveAll(System.Delegate? source, System.Delegate? value) { throw null; } - protected virtual System.Delegate? RemoveImpl(System.Delegate d) { throw null; } + protected virtual System.Delegate? RemoveImpl(System.Delegate? d) { throw null; } public partial struct InvocationListEnumerator where TDelegate : System.Delegate { public TDelegate Current { get { throw null; } } diff --git a/src/mono/System.Private.CoreLib/src/System/MulticastDelegate.Mono.cs b/src/mono/System.Private.CoreLib/src/System/MulticastDelegate.Mono.cs index 47fb79aa3cdfa7..240e9f281bdf41 100644 --- a/src/mono/System.Private.CoreLib/src/System/MulticastDelegate.Mono.cs +++ b/src/mono/System.Private.CoreLib/src/System/MulticastDelegate.Mono.cs @@ -197,7 +197,7 @@ private static int LastIndexOf(Delegate[] haystack, Delegate[] needle) return -1; } - protected sealed override Delegate? RemoveImpl(Delegate value) + protected sealed override Delegate? RemoveImpl(Delegate? value) { if (value == null) return this; From 7c3769b15efd725b8301b60dafb87349dd5b7f52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Petryka?= <35800402+MichalPetryka@users.noreply.github.com> Date: Sun, 21 Jun 2026 00:47:28 +0200 Subject: [PATCH 2/8] Fix RemoveImpl method to handle null delegate --- src/libraries/System.Private.CoreLib/src/System/Delegate.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Delegate.cs b/src/libraries/System.Private.CoreLib/src/System/Delegate.cs index 6efa9f48554fad..98499ddb5a5e80 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Delegate.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Delegate.cs @@ -70,7 +70,7 @@ public abstract partial class Delegate : ICloneable, ISerializable #if !NATIVEAOT protected virtual Delegate CombineImpl(Delegate? d) => throw new MulticastNotSupportedException(SR.Multicast_Combine); - protected virtual Delegate? RemoveImpl(Delegate d) => d.Equals(this) ? null : this; + protected virtual Delegate? RemoveImpl(Delegate? d) => Equals(d) ? null : this; public virtual Delegate[] GetInvocationList() => [this]; From 75bc5a360bfd49ab8404df94c04817750ad6d08c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Petryka?= <35800402+MichalPetryka@users.noreply.github.com> Date: Sun, 21 Jun 2026 01:02:37 +0200 Subject: [PATCH 3/8] Update RemoveImpl method signature to be nullable --- src/libraries/System.Runtime/ref/System.Runtime.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Runtime/ref/System.Runtime.cs b/src/libraries/System.Runtime/ref/System.Runtime.cs index 2ab1d0c207763d..d1b8c8eab38772 100644 --- a/src/libraries/System.Runtime/ref/System.Runtime.cs +++ b/src/libraries/System.Runtime/ref/System.Runtime.cs @@ -4803,7 +4803,7 @@ public abstract partial class MulticastDelegate : System.Delegate public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public static bool operator ==(System.MulticastDelegate? d1, System.MulticastDelegate? d2) { throw null; } public static bool operator !=(System.MulticastDelegate? d1, System.MulticastDelegate? d2) { throw null; } - protected sealed override System.Delegate? RemoveImpl(System.Delegate value) { throw null; } + protected sealed override System.Delegate? RemoveImpl(System.Delegate? value) { throw null; } } public sealed partial class MulticastNotSupportedException : System.SystemException { From b6178dc753a507fa9d51e8d313a42e1d61bd946d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Petryka?= <35800402+MichalPetryka@users.noreply.github.com> Date: Sun, 21 Jun 2026 01:39:59 +0200 Subject: [PATCH 4/8] Use null-forgiving operator in delegate comparison Add null-forgiving operator to value in Equals check. --- .../src/System/MulticastDelegate.CoreCLR.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coreclr/System.Private.CoreLib/src/System/MulticastDelegate.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/MulticastDelegate.CoreCLR.cs index f870126adbeb4f..940ae1207c2138 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/MulticastDelegate.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/MulticastDelegate.CoreCLR.cs @@ -296,9 +296,9 @@ private static bool EqualInvocationLists(object[] a, object[] b, int start, int // the value we need to check for this case // MulticastDelegate? v = value as MulticastDelegate; - if (v == null) return this; + if (v._invocationList is not object[]) { if (_invocationList is not object[] invocationList) @@ -312,7 +312,7 @@ private static bool EqualInvocationLists(object[] a, object[] b, int start, int int invocationCount = (int)_invocationCount; for (int i = invocationCount; --i >= 0;) { - if (value.Equals(invocationList[i])) + if (value!.Equals(invocationList[i])) { if (invocationCount == 2) { From d2e634f2247593f0daa658439a5ad8b5a6d421b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Petryka?= <35800402+MichalPetryka@users.noreply.github.com> Date: Sun, 21 Jun 2026 02:03:54 +0200 Subject: [PATCH 5/8] Rename variable 'value' to 'v' for clarity --- .../src/System/MulticastDelegate.CoreCLR.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coreclr/System.Private.CoreLib/src/System/MulticastDelegate.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/MulticastDelegate.CoreCLR.cs index 940ae1207c2138..a913812b9fb566 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/MulticastDelegate.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/MulticastDelegate.CoreCLR.cs @@ -304,7 +304,7 @@ private static bool EqualInvocationLists(object[] a, object[] b, int start, int if (_invocationList is not object[] invocationList) { // they are both not real Multicast - if (this.Equals(value)) + if (this.Equals(v)) return null; } else @@ -312,7 +312,7 @@ private static bool EqualInvocationLists(object[] a, object[] b, int start, int int invocationCount = (int)_invocationCount; for (int i = invocationCount; --i >= 0;) { - if (value!.Equals(invocationList[i])) + if (v.Equals(invocationList[i])) { if (invocationCount == 2) { From cd61e36e631cf054935e1dcf78b02aaf6e8c84bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Petryka?= Date: Mon, 22 Jun 2026 15:38:06 +0200 Subject: [PATCH 6/8] Remove non public virtuals --- .../src/System/Delegate.CoreCLR.cs | 8 +- .../src/System/MulticastDelegate.CoreCLR.cs | 10 +-- .../src/System/Delegate.cs | 8 +- .../src/System/Delegate.cs | 12 +-- .../System.Runtime/ref/System.Runtime.cs | 7 -- ...iCompatBaseline.NetCoreAppLatestStable.xml | 72 ++++++++++++++++++ .../ApiCompatBaseline.netstandard2.0.xml | 74 ++++++++++++++++++- .../ApiCompatBaseline.netstandard2.1.xml | 38 ++++++++-- .../src/System/Delegate.Mono.cs | 4 +- .../src/System/MulticastDelegate.Mono.cs | 8 +- 10 files changed, 199 insertions(+), 42 deletions(-) diff --git a/src/coreclr/System.Private.CoreLib/src/System/Delegate.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Delegate.CoreCLR.cs index 7539685cb0ad69..f46f5a08362cf5 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Delegate.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Delegate.CoreCLR.cs @@ -77,7 +77,7 @@ protected Delegate([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Al DelegateBindingFlags.CaselessMatching); } - protected virtual object? DynamicInvokeImpl(object?[]? args) + private object? DynamicInvokeImpl(object?[]? args) { RuntimeMethodHandleInternal method = new RuntimeMethodHandleInternal(GetInvokeMethod()); RuntimeMethodInfo invoke = (RuntimeMethodInfo)RuntimeType.GetMethodBase((RuntimeType)GetType(), method)!; @@ -156,7 +156,7 @@ public override int GetHashCode() return GetType().GetHashCode(); } - protected virtual MethodInfo GetMethodImpl() + internal MethodInfo GetMethodImpl() { if (_helperObject is MethodInfo methodInfo) { @@ -218,7 +218,7 @@ protected virtual MethodInfo GetMethodImpl() return (MethodInfo)_helperObject; } - public object? Target => GetTarget(); + public object? Target => Unsafe.As(this).GetTarget(); // V1 API. [RequiresUnreferencedCode("The target method might be removed")] @@ -550,7 +550,7 @@ internal void InitializeVirtualCallStub(IntPtr methodPtr) [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Delegate_InitializeVirtualCallStub")] private static partial void InitializeVirtualCallStub(ObjectHandleOnStack d, IntPtr methodPtr); - internal virtual object? GetTarget() + internal object? GetTarget() { return (_methodPtrAux == IntPtr.Zero) ? _target : null; } diff --git a/src/coreclr/System.Private.CoreLib/src/System/MulticastDelegate.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/MulticastDelegate.CoreCLR.cs index 32ea459dcb23ac..523b90c210d46d 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/MulticastDelegate.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/MulticastDelegate.CoreCLR.cs @@ -172,7 +172,7 @@ internal void StoreDynamicMethod(MethodInfo dynamicMethod) // This method will combine this delegate with the passed delegate // to form a new delegate. - protected sealed override Delegate CombineImpl(Delegate? follow) + internal Delegate CombineImpl(Delegate? follow) { if (follow is null) return this; @@ -290,7 +290,7 @@ private static bool EqualInvocationLists(object[] a, object[] b, int start, int // 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 sealed override Delegate? RemoveImpl(Delegate? value) + internal Delegate? RemoveImpl(Delegate? value) { // There is a special case were we are removing using a delegate as // the value we need to check for this case @@ -418,7 +418,7 @@ public sealed override int GetHashCode() } } - internal override object? GetTarget() + internal new object? GetTarget() { if (_invocationCount != 0) { @@ -436,14 +436,14 @@ public sealed override int GetHashCode() if (_invocationList is object[] invocationList) { int invocationCount = (int)_invocationCount; - return ((Delegate)invocationList[invocationCount - 1]).GetTarget(); + return ((MulticastDelegate)invocationList[invocationCount - 1]).GetTarget(); } } } return base.GetTarget(); } - protected override MethodInfo GetMethodImpl() + internal new MethodInfo GetMethodImpl() { if (_invocationList is object[] invocationList) { diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Delegate.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Delegate.cs index e8d3d7a6c1e79c..eea1621b4e381f 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Delegate.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Delegate.cs @@ -232,7 +232,7 @@ private IntPtr GetActualTargetFunctionPointer(object thisObject) internal bool IsDynamicDelegate() => GetThunk(MulticastThunk) == IntPtr.Zero; [DebuggerGuidedStepThroughAttribute] - protected virtual object? DynamicInvokeImpl(object?[]? args) + private object? DynamicInvokeImpl(object?[]? args) { if (IsDynamicDelegate()) { @@ -252,7 +252,7 @@ private IntPtr GetActualTargetFunctionPointer(object thisObject) } } - protected virtual MethodInfo GetMethodImpl() + internal MethodInfo GetMethodImpl() { // NOTE: this implementation is mirrored in GetDiagnosticMethodInfo below @@ -484,7 +484,7 @@ private static bool TrySetSlot(Wrapper[] 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? d) + internal Delegate CombineImpl(Delegate? d) { if (d is null) return this; @@ -602,7 +602,7 @@ private static bool EqualInvocationLists(Wrapper[] a, Wrapper[] b, int start, in // 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? d) + internal 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 diff --git a/src/libraries/System.Private.CoreLib/src/System/Delegate.cs b/src/libraries/System.Private.CoreLib/src/System/Delegate.cs index 98499ddb5a5e80..48c5c5c2037095 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Delegate.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Delegate.cs @@ -20,7 +20,7 @@ public abstract partial class Delegate : ICloneable, ISerializable if (a is null) return b; - return a.CombineImpl(b); + return Unsafe.As(a).CombineImpl(b); } public static Delegate? Combine(params Delegate?[]? delegates) => @@ -68,10 +68,6 @@ public abstract partial class Delegate : ICloneable, ISerializable public static Delegate CreateDelegate(Type type, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.AllMethods)] Type target, string method, bool ignoreCase) => CreateDelegate(type, target, method, ignoreCase, throwOnBindFailure: true)!; #if !NATIVEAOT - protected virtual Delegate CombineImpl(Delegate? d) => throw new MulticastNotSupportedException(SR.Multicast_Combine); - - protected virtual Delegate? RemoveImpl(Delegate? d) => Equals(d) ? null : this; - public virtual Delegate[] GetInvocationList() => [this]; /// @@ -146,14 +142,14 @@ public bool MoveNext() public object? DynamicInvoke(params object?[]? args) { - return DynamicInvokeImpl(args); + return Unsafe.As(this).DynamicInvokeImpl(args); } [Obsolete(Obsoletions.LegacyFormatterImplMessage, DiagnosticId = Obsoletions.LegacyFormatterImplDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] [EditorBrowsable(EditorBrowsableState.Never)] public virtual void GetObjectData(SerializationInfo info, StreamingContext context) => throw new PlatformNotSupportedException(); - public MethodInfo Method => GetMethodImpl(); + public MethodInfo Method => Unsafe.As(this).GetMethodImpl(); public static Delegate? Remove(Delegate? source, Delegate? value) { @@ -166,7 +162,7 @@ public bool MoveNext() if (!InternalEqualTypes(source, value)) throw new ArgumentException(SR.Arg_DlgtTypeMis); - return source.RemoveImpl(value); + return Unsafe.As(source).RemoveImpl(value); } public static Delegate? RemoveAll(Delegate? source, Delegate? value) diff --git a/src/libraries/System.Runtime/ref/System.Runtime.cs b/src/libraries/System.Runtime/ref/System.Runtime.cs index d1b8c8eab38772..659792cde156d9 100644 --- a/src/libraries/System.Runtime/ref/System.Runtime.cs +++ b/src/libraries/System.Runtime/ref/System.Runtime.cs @@ -2342,7 +2342,6 @@ protected Delegate([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAt public static System.Delegate? Combine(System.Delegate? a, System.Delegate? b) { throw null; } public static System.Delegate? Combine(params System.Delegate?[]? delegates) { throw null; } public static System.Delegate? Combine(params System.ReadOnlySpan delegates) { throw null; } - protected virtual System.Delegate CombineImpl(System.Delegate? d) { throw null; } public static System.Delegate CreateDelegate(System.Type type, object? firstArgument, System.Reflection.MethodInfo method) { throw null; } public static System.Delegate? CreateDelegate(System.Type type, object? firstArgument, System.Reflection.MethodInfo method, bool throwOnBindFailure) { throw null; } [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The target method might be removed")] @@ -2357,12 +2356,10 @@ protected Delegate([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAt public static System.Delegate CreateDelegate(System.Type type, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.AllMethods)] System.Type target, string method, bool ignoreCase) { throw null; } public static System.Delegate? CreateDelegate(System.Type type, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.AllMethods)] System.Type target, string method, bool ignoreCase, bool throwOnBindFailure) { throw null; } public object? DynamicInvoke(params object?[]? args) { throw null; } - protected virtual object? DynamicInvokeImpl(object?[]? args) { throw null; } public static System.Delegate.InvocationListEnumerator EnumerateInvocationList(TDelegate? d) where TDelegate : System.Delegate { throw null; } public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } public virtual System.Delegate[] GetInvocationList() { throw null; } - protected virtual System.Reflection.MethodInfo GetMethodImpl() { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")] public virtual void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } @@ -2370,7 +2367,6 @@ public virtual void GetObjectData(System.Runtime.Serialization.SerializationInfo public static bool operator !=(System.Delegate? d1, System.Delegate? d2) { throw null; } public static System.Delegate? Remove(System.Delegate? source, System.Delegate? value) { throw null; } public static System.Delegate? RemoveAll(System.Delegate? source, System.Delegate? value) { throw null; } - protected virtual System.Delegate? RemoveImpl(System.Delegate? d) { throw null; } public partial struct InvocationListEnumerator where TDelegate : System.Delegate { public TDelegate Current { get { throw null; } } @@ -4793,17 +4789,14 @@ public abstract partial class MulticastDelegate : System.Delegate [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The target method might be removed")] protected MulticastDelegate(object target, string method) : base (default(object), default(string)) { } protected MulticastDelegate([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.AllMethods)] System.Type target, string method) : base (default(object), default(string)) { } - protected sealed override System.Delegate CombineImpl(System.Delegate? follow) { throw null; } public sealed override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } public sealed override int GetHashCode() { throw null; } public sealed override System.Delegate[] GetInvocationList() { throw null; } - protected override System.Reflection.MethodInfo GetMethodImpl() { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")] public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public static bool operator ==(System.MulticastDelegate? d1, System.MulticastDelegate? d2) { throw null; } public static bool operator !=(System.MulticastDelegate? d1, System.MulticastDelegate? d2) { throw null; } - protected sealed override System.Delegate? RemoveImpl(System.Delegate? value) { throw null; } } public sealed partial class MulticastNotSupportedException : System.SystemException { diff --git a/src/libraries/apicompat/ApiCompatBaseline.NetCoreAppLatestStable.xml b/src/libraries/apicompat/ApiCompatBaseline.NetCoreAppLatestStable.xml index 95960d00eda311..db9ac64eb853aa 100644 --- a/src/libraries/apicompat/ApiCompatBaseline.NetCoreAppLatestStable.xml +++ b/src/libraries/apicompat/ApiCompatBaseline.NetCoreAppLatestStable.xml @@ -1,6 +1,78 @@ + + CP0002 + M:System.Delegate.CombineImpl(System.Delegate) + net10.0/mscorlib.dll + net11.0/mscorlib.dll + + + CP0002 + M:System.Delegate.DynamicInvokeImpl(System.Object[]) + net10.0/mscorlib.dll + net11.0/mscorlib.dll + + + CP0002 + M:System.Delegate.GetMethodImpl + net10.0/mscorlib.dll + net11.0/mscorlib.dll + + + CP0002 + M:System.Delegate.RemoveImpl(System.Delegate) + net10.0/mscorlib.dll + net11.0/mscorlib.dll + + + CP0002 + M:System.Delegate.CombineImpl(System.Delegate) + net10.0/netstandard.dll + net11.0/netstandard.dll + + + CP0002 + M:System.Delegate.DynamicInvokeImpl(System.Object[]) + net10.0/netstandard.dll + net11.0/netstandard.dll + + + CP0002 + M:System.Delegate.GetMethodImpl + net10.0/netstandard.dll + net11.0/netstandard.dll + + + CP0002 + M:System.Delegate.RemoveImpl(System.Delegate) + net10.0/netstandard.dll + net11.0/netstandard.dll + + + CP0002 + M:System.Delegate.CombineImpl(System.Delegate) + net10.0/System.Runtime.dll + net11.0/System.Runtime.dll + + + CP0002 + M:System.Delegate.DynamicInvokeImpl(System.Object[]) + net10.0/System.Runtime.dll + net11.0/System.Runtime.dll + + + CP0002 + M:System.Delegate.GetMethodImpl + net10.0/System.Runtime.dll + net11.0/System.Runtime.dll + + + CP0002 + M:System.Delegate.RemoveImpl(System.Delegate) + net10.0/System.Runtime.dll + net11.0/System.Runtime.dll + CP0002 M:System.Runtime.Intrinsics.Arm.Sve.CreateWhileLessThanMask16Bit(System.Int32,System.Int32) diff --git a/src/libraries/apicompat/ApiCompatBaseline.netstandard2.0.xml b/src/libraries/apicompat/ApiCompatBaseline.netstandard2.0.xml index 8d18b718a612ae..ff617479e36ec1 100644 --- a/src/libraries/apicompat/ApiCompatBaseline.netstandard2.0.xml +++ b/src/libraries/apicompat/ApiCompatBaseline.netstandard2.0.xml @@ -1,4 +1,4 @@ - + @@ -7,6 +7,30 @@ netstandard2.0/System.ComponentModel.Composition.dll right + + CP0002 + M:System.Delegate.CombineImpl(System.Delegate) + netstandard2.0/mscorlib.dll + net11.0/mscorlib.dll + + + CP0002 + M:System.Delegate.DynamicInvokeImpl(System.Object[]) + netstandard2.0/mscorlib.dll + net11.0/mscorlib.dll + + + CP0002 + M:System.Delegate.GetMethodImpl + netstandard2.0/mscorlib.dll + net11.0/mscorlib.dll + + + CP0002 + M:System.Delegate.RemoveImpl(System.Delegate) + netstandard2.0/mscorlib.dll + net11.0/mscorlib.dll + CP0002 M:System.ComponentModel.BaseNumberConverter.#ctor @@ -37,6 +61,30 @@ netstandard2.0/netstandard.dll net11.0/netstandard.dll + + CP0002 + M:System.Delegate.CombineImpl(System.Delegate) + netstandard2.0/netstandard.dll + net11.0/netstandard.dll + + + CP0002 + M:System.Delegate.DynamicInvokeImpl(System.Object[]) + netstandard2.0/netstandard.dll + net11.0/netstandard.dll + + + CP0002 + M:System.Delegate.GetMethodImpl + netstandard2.0/netstandard.dll + net11.0/netstandard.dll + + + CP0002 + M:System.Delegate.RemoveImpl(System.Delegate) + netstandard2.0/netstandard.dll + net11.0/netstandard.dll + CP0002 M:System.Linq.EnumerableExecutor.#ctor @@ -121,6 +169,30 @@ netstandard2.0/System.Linq.Queryable.dll net11.0/System.Linq.Queryable.dll + + CP0002 + M:System.Delegate.CombineImpl(System.Delegate) + netstandard2.0/System.Runtime.dll + net11.0/System.Runtime.dll + + + CP0002 + M:System.Delegate.DynamicInvokeImpl(System.Object[]) + netstandard2.0/System.Runtime.dll + net11.0/System.Runtime.dll + + + CP0002 + M:System.Delegate.GetMethodImpl + netstandard2.0/System.Runtime.dll + net11.0/System.Runtime.dll + + + CP0002 + M:System.Delegate.RemoveImpl(System.Delegate) + netstandard2.0/System.Runtime.dll + net11.0/System.Runtime.dll + CP0002 M:System.Xml.Schema.XmlSchemaDatatype.#ctor diff --git a/src/libraries/apicompat/ApiCompatBaseline.netstandard2.1.xml b/src/libraries/apicompat/ApiCompatBaseline.netstandard2.1.xml index a11fe6cb50a601..30b14fb37d5829 100644 --- a/src/libraries/apicompat/ApiCompatBaseline.netstandard2.1.xml +++ b/src/libraries/apicompat/ApiCompatBaseline.netstandard2.1.xml @@ -1,6 +1,30 @@ - + + + CP0002 + M:System.Delegate.CombineImpl(System.Delegate) + netstandard2.1/netstandard.dll + net11.0/netstandard.dll + + + CP0002 + M:System.Delegate.DynamicInvokeImpl(System.Object[]) + netstandard2.1/netstandard.dll + net11.0/netstandard.dll + + + CP0002 + M:System.Delegate.GetMethodImpl + netstandard2.1/netstandard.dll + net11.0/netstandard.dll + + + CP0002 + M:System.Delegate.RemoveImpl(System.Delegate) + netstandard2.1/netstandard.dll + net11.0/netstandard.dll + CP0014 E:System.Diagnostics.Process.ErrorDataReceived:[T:System.ComponentModel.BrowsableAttribute] @@ -853,6 +877,12 @@ netstandard2.1/netstandard.dll net11.0/netstandard.dll + + CP0015 + T:System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute:[T:System.AttributeUsageAttribute] + netstandard2.1/netstandard.dll + net11.0/netstandard.dll + CP0015 T:System.Runtime.CompilerServices.AsyncMethodBuilderAttribute:[T:System.AttributeUsageAttribute] @@ -1003,10 +1033,4 @@ netstandard2.1/netstandard.dll net11.0/netstandard.dll - - CP0015 - T:System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute:[T:System.AttributeUsageAttribute] - netstandard2.1/netstandard.dll - net11.0/netstandard.dll - \ No newline at end of file diff --git a/src/mono/System.Private.CoreLib/src/System/Delegate.Mono.cs b/src/mono/System.Private.CoreLib/src/System/Delegate.Mono.cs index de3120dac128f2..12dcc7886f38af 100644 --- a/src/mono/System.Private.CoreLib/src/System/Delegate.Mono.cs +++ b/src/mono/System.Private.CoreLib/src/System/Delegate.Mono.cs @@ -423,7 +423,7 @@ private static bool IsArgumentTypeMatchWithThis(Type delArgType, Type argType, b return match; } - protected virtual object? DynamicInvokeImpl(object?[]? args) + internal object? DynamicInvokeImpl(object?[]? args) { MethodInfo method = Method; @@ -518,7 +518,7 @@ public override int GetHashCode() return (m != null ? m.GetHashCode() : GetType().GetHashCode()) ^ RuntimeHelpers.GetHashCode(_target); } - protected virtual MethodInfo GetMethodImpl() + internal MethodInfo GetMethodImpl() { if (method_info != null) return method_info; diff --git a/src/mono/System.Private.CoreLib/src/System/MulticastDelegate.Mono.cs b/src/mono/System.Private.CoreLib/src/System/MulticastDelegate.Mono.cs index 240e9f281bdf41..3f7b826c15470e 100644 --- a/src/mono/System.Private.CoreLib/src/System/MulticastDelegate.Mono.cs +++ b/src/mono/System.Private.CoreLib/src/System/MulticastDelegate.Mono.cs @@ -21,7 +21,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont throw new SerializationException(SR.Serialization_DelegatesNotSupported); } - protected sealed override object? DynamicInvokeImpl(object?[]? args) + internal new object? DynamicInvokeImpl(object?[]? args) { if (delegates == null) { @@ -82,7 +82,7 @@ public sealed override int GetHashCode() return base.GetHashCode(); } - protected override MethodInfo GetMethodImpl() + internal new MethodInfo GetMethodImpl() { if (delegates != null) return delegates[delegates.Length - 1].Method; @@ -126,7 +126,7 @@ public sealed override Delegate[] GetInvocationList() // thing should have better been a simple System.Delegate class. // Compiler generated delegates are always MulticastDelegates. // - protected sealed override Delegate CombineImpl(Delegate? follow) + internal Delegate CombineImpl(Delegate? follow) { if (follow == null) return this; @@ -197,7 +197,7 @@ private static int LastIndexOf(Delegate[] haystack, Delegate[] needle) return -1; } - protected sealed override Delegate? RemoveImpl(Delegate? value) + internal Delegate? RemoveImpl(Delegate? value) { if (value == null) return this; From 6e0e78faa1177f35052d7f71282e2bd4d4f6bf6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Petryka?= Date: Mon, 22 Jun 2026 18:10:44 +0200 Subject: [PATCH 7/8] Address feedback --- .../CompatibilitySuppressions.xml | 4 +- .../src/System/Delegate.CoreCLR.cs | 8 +- .../src/System/MulticastDelegate.CoreCLR.cs | 12 +- .../src/CompatibilitySuppressions.xml | 64 ++++++--- .../src/System/Delegate.cs | 10 +- .../src/CompatibilitySuppressions.xml | 3 +- .../src/CompatibilitySuppressions.xml | 2 +- .../src/CompatibilitySuppressions.xml | 2 +- .../src/System/Delegate.cs | 14 +- .../src/CompatibilitySuppressions.xml | 2 +- .../System.Runtime/ref/System.Runtime.cs | 8 +- .../src/CompatibilitySuppressions.xml | 4 +- ...iCompatBaseline.NetCoreAppLatestStable.xml | 126 ++++++++---------- .../ApiCompatBaseline.netstandard2.0.xml | 126 ++++++++---------- .../ApiCompatBaseline.netstandard2.1.xml | 14 +- .../src/System/Delegate.Mono.cs | 4 +- .../src/System/MulticastDelegate.Mono.cs | 10 +- 17 files changed, 203 insertions(+), 210 deletions(-) diff --git a/src/coreclr/System.Private.CoreLib/CompatibilitySuppressions.xml b/src/coreclr/System.Private.CoreLib/CompatibilitySuppressions.xml index 141210a166bc8f..17dfc127110220 100644 --- a/src/coreclr/System.Private.CoreLib/CompatibilitySuppressions.xml +++ b/src/coreclr/System.Private.CoreLib/CompatibilitySuppressions.xml @@ -1,4 +1,4 @@ - + @@ -29,4 +29,4 @@ CP0008 T:System.Collections.BitArray - + \ No newline at end of file diff --git a/src/coreclr/System.Private.CoreLib/src/System/Delegate.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Delegate.CoreCLR.cs index f46f5a08362cf5..7539685cb0ad69 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Delegate.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Delegate.CoreCLR.cs @@ -77,7 +77,7 @@ protected Delegate([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Al DelegateBindingFlags.CaselessMatching); } - private object? DynamicInvokeImpl(object?[]? args) + protected virtual object? DynamicInvokeImpl(object?[]? args) { RuntimeMethodHandleInternal method = new RuntimeMethodHandleInternal(GetInvokeMethod()); RuntimeMethodInfo invoke = (RuntimeMethodInfo)RuntimeType.GetMethodBase((RuntimeType)GetType(), method)!; @@ -156,7 +156,7 @@ public override int GetHashCode() return GetType().GetHashCode(); } - internal MethodInfo GetMethodImpl() + protected virtual MethodInfo GetMethodImpl() { if (_helperObject is MethodInfo methodInfo) { @@ -218,7 +218,7 @@ internal MethodInfo GetMethodImpl() return (MethodInfo)_helperObject; } - public object? Target => Unsafe.As(this).GetTarget(); + public object? Target => GetTarget(); // V1 API. [RequiresUnreferencedCode("The target method might be removed")] @@ -550,7 +550,7 @@ internal void InitializeVirtualCallStub(IntPtr methodPtr) [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Delegate_InitializeVirtualCallStub")] private static partial void InitializeVirtualCallStub(ObjectHandleOnStack d, IntPtr methodPtr); - internal object? GetTarget() + internal virtual object? GetTarget() { return (_methodPtrAux == IntPtr.Zero) ? _target : null; } diff --git a/src/coreclr/System.Private.CoreLib/src/System/MulticastDelegate.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/MulticastDelegate.CoreCLR.cs index 523b90c210d46d..d5727eb2ce13b4 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/MulticastDelegate.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/MulticastDelegate.CoreCLR.cs @@ -172,7 +172,7 @@ internal void StoreDynamicMethod(MethodInfo dynamicMethod) // This method will combine this delegate with the passed delegate // to form a new delegate. - internal Delegate CombineImpl(Delegate? follow) + internal new Delegate CombineImpl(Delegate? follow) { if (follow is null) return this; @@ -290,7 +290,7 @@ private static bool EqualInvocationLists(object[] a, object[] b, int start, int // 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. - internal Delegate? RemoveImpl(Delegate? value) + internal new Delegate? RemoveImpl(Delegate? value) { // There is a special case were we are removing using a delegate as // the value we need to check for this case @@ -362,7 +362,7 @@ private static bool EqualInvocationLists(object[] a, object[] b, int start, int } // This method returns the Invocation list of this multicast delegate. - public sealed override Delegate[] GetInvocationList() + internal new Delegate[] GetInvocationList() { Delegate[] del; if (_invocationList is not object[] invocationList) @@ -418,7 +418,7 @@ public sealed override int GetHashCode() } } - internal new object? GetTarget() + internal override object? GetTarget() { if (_invocationCount != 0) { @@ -436,14 +436,14 @@ public sealed override int GetHashCode() if (_invocationList is object[] invocationList) { int invocationCount = (int)_invocationCount; - return ((MulticastDelegate)invocationList[invocationCount - 1]).GetTarget(); + return ((Delegate)invocationList[invocationCount - 1]).GetTarget(); } } } return base.GetTarget(); } - internal new MethodInfo GetMethodImpl() + protected override MethodInfo GetMethodImpl() { if (_invocationList is object[] invocationList) { diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/CompatibilitySuppressions.xml b/src/coreclr/nativeaot/System.Private.CoreLib/src/CompatibilitySuppressions.xml index b85912e6cf1ff0..665cee998ca125 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/CompatibilitySuppressions.xml +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/CompatibilitySuppressions.xml @@ -1,6 +1,10 @@ - + + + CP0001 + T:Internal.Console + CP0001 T:Internal.Metadata.NativeFormat.ArraySignature @@ -53,14 +57,6 @@ CP0001 T:Internal.Metadata.NativeFormat.ConstantBooleanValueHandle - - CP0001 - T:Internal.Metadata.NativeFormat.ConstantEnumValue - - - CP0001 - T:Internal.Metadata.NativeFormat.ConstantEnumValueHandle - CP0001 T:Internal.Metadata.NativeFormat.ConstantByteArray @@ -117,6 +113,14 @@ CP0001 T:Internal.Metadata.NativeFormat.ConstantEnumArrayHandle + + CP0001 + T:Internal.Metadata.NativeFormat.ConstantEnumValue + + + CP0001 + T:Internal.Metadata.NativeFormat.ConstantEnumValueHandle + CP0001 T:Internal.Metadata.NativeFormat.ConstantHandleArray @@ -653,6 +657,10 @@ CP0001 T:Internal.Metadata.NativeFormat.UInt64Collection + + CP0001 + T:Internal.NativeFormat.TypeHashingAlgorithms + CP0001 T:Internal.Reflection.Core.AssemblyBinder @@ -725,6 +733,10 @@ CP0001 T:Internal.TypeSystem.LockFreeReaderHashtable`2 + + CP0001 + T:Internal.TypeSystem.LockFreeReaderHashtableOfPointers`2 + CP0001 T:System.Diagnostics.DebugAnnotations @@ -735,11 +747,11 @@ CP0001 - T:System.MDArray + T:System.FieldHandleInfo CP0001 - T:System.FieldHandleInfo + T:System.MDArray CP0001 @@ -806,8 +818,16 @@ T:System.Runtime.CompilerServices.StaticClassConstructionContext - CP0001 - T:Internal.TypeSystem.LockFreeReaderHashtableOfPointers`2 + CP0002 + F:System.Resources.ResourceManager.BaseNameField + + + CP0002 + F:System.Resources.ResourceSet.Reader + + + CP0002 + M:System.Diagnostics.DiagnosticMethodInfo.#ctor(System.String,System.String,System.String) CP0002 @@ -815,14 +835,22 @@ CP0002 - M:System.Threading.Lock.#ctor(System.Boolean) + M:System.String.Trim(System.ReadOnlySpan{System.Char}) CP0002 - M:System.Diagnostics.DiagnosticMethodInfo.#ctor(System.String,System.String,System.String) + M:System.String.TrimEnd(System.ReadOnlySpan{System.Char}) - CP0001 - T:Internal.NativeFormat.TypeHashingAlgorithms + CP0002 + M:System.String.TrimStart(System.ReadOnlySpan{System.Char}) + + + CP0002 + M:System.Threading.Lock.#ctor(System.Boolean) + + + CP0008 + T:System.Collections.BitArray - + \ No newline at end of file diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Delegate.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Delegate.cs index eea1621b4e381f..0f3d189050dfd6 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Delegate.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Delegate.cs @@ -232,7 +232,7 @@ private IntPtr GetActualTargetFunctionPointer(object thisObject) internal bool IsDynamicDelegate() => GetThunk(MulticastThunk) == IntPtr.Zero; [DebuggerGuidedStepThroughAttribute] - private object? DynamicInvokeImpl(object?[]? args) + protected virtual object? DynamicInvokeImpl(object?[]? args) { if (IsDynamicDelegate()) { @@ -252,7 +252,7 @@ private IntPtr GetActualTargetFunctionPointer(object thisObject) } } - internal MethodInfo GetMethodImpl() + protected virtual MethodInfo GetMethodImpl() { // NOTE: this implementation is mirrored in GetDiagnosticMethodInfo below @@ -484,7 +484,7 @@ private static bool TrySetSlot(Wrapper[] a, int index, Delegate o) // This method will combine this delegate with the passed delegate // to form a new delegate. - internal Delegate CombineImpl(Delegate? d) + protected Delegate CombineImpl(Delegate? d) { if (d is null) return this; @@ -602,7 +602,7 @@ private static bool EqualInvocationLists(Wrapper[] a, Wrapper[] b, int start, in // 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. - internal Delegate? RemoveImpl(Delegate? d) + protected 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 @@ -671,7 +671,7 @@ private static bool EqualInvocationLists(Wrapper[] a, Wrapper[] b, int start, in return this; } - public virtual Delegate[] GetInvocationList() + public Delegate[] GetInvocationList() { if (_helperObject is Wrapper[] invocationList) { diff --git a/src/libraries/System.Collections.Specialized/src/CompatibilitySuppressions.xml b/src/libraries/System.Collections.Specialized/src/CompatibilitySuppressions.xml index d6c64b01d2cd7a..9ca61f831d39df 100644 --- a/src/libraries/System.Collections.Specialized/src/CompatibilitySuppressions.xml +++ b/src/libraries/System.Collections.Specialized/src/CompatibilitySuppressions.xml @@ -1,7 +1,6 @@ - + - CP0001 T:System.Collections.Specialized.ListDictionary.DictionaryNode diff --git a/src/libraries/System.Collections/src/CompatibilitySuppressions.xml b/src/libraries/System.Collections/src/CompatibilitySuppressions.xml index 52276bd955eb14..bac766f06ed6b5 100644 --- a/src/libraries/System.Collections/src/CompatibilitySuppressions.xml +++ b/src/libraries/System.Collections/src/CompatibilitySuppressions.xml @@ -1,4 +1,4 @@ - + diff --git a/src/libraries/System.Linq.Expressions/src/CompatibilitySuppressions.xml b/src/libraries/System.Linq.Expressions/src/CompatibilitySuppressions.xml index 739e336d8b4cad..02d0150a0d431b 100644 --- a/src/libraries/System.Linq.Expressions/src/CompatibilitySuppressions.xml +++ b/src/libraries/System.Linq.Expressions/src/CompatibilitySuppressions.xml @@ -1,4 +1,4 @@ - + diff --git a/src/libraries/System.Private.CoreLib/src/System/Delegate.cs b/src/libraries/System.Private.CoreLib/src/System/Delegate.cs index 48c5c5c2037095..0e4c4d28ec5122 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Delegate.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Delegate.cs @@ -20,7 +20,7 @@ public abstract partial class Delegate : ICloneable, ISerializable if (a is null) return b; - return Unsafe.As(a).CombineImpl(b); + return a.CombineImpl(b); } public static Delegate? Combine(params Delegate?[]? delegates) => @@ -68,7 +68,11 @@ public abstract partial class Delegate : ICloneable, ISerializable public static Delegate CreateDelegate(Type type, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.AllMethods)] Type target, string method, bool ignoreCase) => CreateDelegate(type, target, method, ignoreCase, throwOnBindFailure: true)!; #if !NATIVEAOT - public virtual Delegate[] GetInvocationList() => [this]; + protected Delegate CombineImpl(Delegate? d) => Unsafe.As(this).CombineImpl(d); + + protected Delegate? RemoveImpl(Delegate? d) => Unsafe.As(this).RemoveImpl(d); + + public Delegate[] GetInvocationList() => Unsafe.As(this).GetInvocationList(); /// /// Gets a value that indicates whether the has a single invocation target. @@ -142,14 +146,14 @@ public bool MoveNext() public object? DynamicInvoke(params object?[]? args) { - return Unsafe.As(this).DynamicInvokeImpl(args); + return DynamicInvokeImpl(args); } [Obsolete(Obsoletions.LegacyFormatterImplMessage, DiagnosticId = Obsoletions.LegacyFormatterImplDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] [EditorBrowsable(EditorBrowsableState.Never)] public virtual void GetObjectData(SerializationInfo info, StreamingContext context) => throw new PlatformNotSupportedException(); - public MethodInfo Method => Unsafe.As(this).GetMethodImpl(); + public MethodInfo Method => GetMethodImpl(); public static Delegate? Remove(Delegate? source, Delegate? value) { @@ -162,7 +166,7 @@ public bool MoveNext() if (!InternalEqualTypes(source, value)) throw new ArgumentException(SR.Arg_DlgtTypeMis); - return Unsafe.As(source).RemoveImpl(value); + return source.RemoveImpl(value); } public static Delegate? RemoveAll(Delegate? source, Delegate? value) diff --git a/src/libraries/System.Runtime.InteropServices/src/CompatibilitySuppressions.xml b/src/libraries/System.Runtime.InteropServices/src/CompatibilitySuppressions.xml index da3c19b3810459..7d38f8a49e7657 100644 --- a/src/libraries/System.Runtime.InteropServices/src/CompatibilitySuppressions.xml +++ b/src/libraries/System.Runtime.InteropServices/src/CompatibilitySuppressions.xml @@ -1,4 +1,4 @@ - + diff --git a/src/libraries/System.Runtime/ref/System.Runtime.cs b/src/libraries/System.Runtime/ref/System.Runtime.cs index 659792cde156d9..22815eb1d97c25 100644 --- a/src/libraries/System.Runtime/ref/System.Runtime.cs +++ b/src/libraries/System.Runtime/ref/System.Runtime.cs @@ -2342,6 +2342,7 @@ protected Delegate([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAt public static System.Delegate? Combine(System.Delegate? a, System.Delegate? b) { throw null; } public static System.Delegate? Combine(params System.Delegate?[]? delegates) { throw null; } public static System.Delegate? Combine(params System.ReadOnlySpan delegates) { throw null; } + protected System.Delegate CombineImpl(System.Delegate? d) { throw null; } public static System.Delegate CreateDelegate(System.Type type, object? firstArgument, System.Reflection.MethodInfo method) { throw null; } public static System.Delegate? CreateDelegate(System.Type type, object? firstArgument, System.Reflection.MethodInfo method, bool throwOnBindFailure) { throw null; } [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The target method might be removed")] @@ -2356,10 +2357,12 @@ protected Delegate([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAt public static System.Delegate CreateDelegate(System.Type type, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.AllMethods)] System.Type target, string method, bool ignoreCase) { throw null; } public static System.Delegate? CreateDelegate(System.Type type, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.AllMethods)] System.Type target, string method, bool ignoreCase, bool throwOnBindFailure) { throw null; } public object? DynamicInvoke(params object?[]? args) { throw null; } + protected virtual object? DynamicInvokeImpl(object?[]? args) { throw null; } public static System.Delegate.InvocationListEnumerator EnumerateInvocationList(TDelegate? d) where TDelegate : System.Delegate { throw null; } public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } public override int GetHashCode() { throw null; } - public virtual System.Delegate[] GetInvocationList() { throw null; } + public System.Delegate[] GetInvocationList() { throw null; } + protected virtual System.Reflection.MethodInfo GetMethodImpl() { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")] public virtual void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } @@ -2367,6 +2370,7 @@ public virtual void GetObjectData(System.Runtime.Serialization.SerializationInfo public static bool operator !=(System.Delegate? d1, System.Delegate? d2) { throw null; } public static System.Delegate? Remove(System.Delegate? source, System.Delegate? value) { throw null; } public static System.Delegate? RemoveAll(System.Delegate? source, System.Delegate? value) { throw null; } + protected System.Delegate? RemoveImpl(System.Delegate? d) { throw null; } public partial struct InvocationListEnumerator where TDelegate : System.Delegate { public TDelegate Current { get { throw null; } } @@ -4791,7 +4795,7 @@ public abstract partial class MulticastDelegate : System.Delegate protected MulticastDelegate([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.AllMethods)] System.Type target, string method) : base (default(object), default(string)) { } public sealed override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } public sealed override int GetHashCode() { throw null; } - public sealed override System.Delegate[] GetInvocationList() { throw null; } + protected override System.Reflection.MethodInfo GetMethodImpl() { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")] public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } diff --git a/src/libraries/System.Runtime/src/CompatibilitySuppressions.xml b/src/libraries/System.Runtime/src/CompatibilitySuppressions.xml index 8d6cd745858ae4..d4d76a349c60bd 100644 --- a/src/libraries/System.Runtime/src/CompatibilitySuppressions.xml +++ b/src/libraries/System.Runtime/src/CompatibilitySuppressions.xml @@ -1,4 +1,4 @@ - + @@ -13,4 +13,4 @@ CP0002 M:System.Runtime.Serialization.SerializationInfo.StartDeserialization - + \ No newline at end of file diff --git a/src/libraries/apicompat/ApiCompatBaseline.NetCoreAppLatestStable.xml b/src/libraries/apicompat/ApiCompatBaseline.NetCoreAppLatestStable.xml index db9ac64eb853aa..065f3eff037105 100644 --- a/src/libraries/apicompat/ApiCompatBaseline.NetCoreAppLatestStable.xml +++ b/src/libraries/apicompat/ApiCompatBaseline.NetCoreAppLatestStable.xml @@ -1,78 +1,6 @@ - - CP0002 - M:System.Delegate.CombineImpl(System.Delegate) - net10.0/mscorlib.dll - net11.0/mscorlib.dll - - - CP0002 - M:System.Delegate.DynamicInvokeImpl(System.Object[]) - net10.0/mscorlib.dll - net11.0/mscorlib.dll - - - CP0002 - M:System.Delegate.GetMethodImpl - net10.0/mscorlib.dll - net11.0/mscorlib.dll - - - CP0002 - M:System.Delegate.RemoveImpl(System.Delegate) - net10.0/mscorlib.dll - net11.0/mscorlib.dll - - - CP0002 - M:System.Delegate.CombineImpl(System.Delegate) - net10.0/netstandard.dll - net11.0/netstandard.dll - - - CP0002 - M:System.Delegate.DynamicInvokeImpl(System.Object[]) - net10.0/netstandard.dll - net11.0/netstandard.dll - - - CP0002 - M:System.Delegate.GetMethodImpl - net10.0/netstandard.dll - net11.0/netstandard.dll - - - CP0002 - M:System.Delegate.RemoveImpl(System.Delegate) - net10.0/netstandard.dll - net11.0/netstandard.dll - - - CP0002 - M:System.Delegate.CombineImpl(System.Delegate) - net10.0/System.Runtime.dll - net11.0/System.Runtime.dll - - - CP0002 - M:System.Delegate.DynamicInvokeImpl(System.Object[]) - net10.0/System.Runtime.dll - net11.0/System.Runtime.dll - - - CP0002 - M:System.Delegate.GetMethodImpl - net10.0/System.Runtime.dll - net11.0/System.Runtime.dll - - - CP0002 - M:System.Delegate.RemoveImpl(System.Delegate) - net10.0/System.Runtime.dll - net11.0/System.Runtime.dll - CP0002 M:System.Runtime.Intrinsics.Arm.Sve.CreateWhileLessThanMask16Bit(System.Int32,System.Int32) @@ -409,6 +337,60 @@ net10.0/System.Runtime.Intrinsics.dll net11.0/System.Runtime.Intrinsics.dll + + CP0012 + M:System.Delegate.CombineImpl(System.Delegate) + net10.0/mscorlib.dll + net11.0/mscorlib.dll + + + CP0012 + M:System.Delegate.GetInvocationList + net10.0/mscorlib.dll + net11.0/mscorlib.dll + + + CP0012 + M:System.Delegate.RemoveImpl(System.Delegate) + net10.0/mscorlib.dll + net11.0/mscorlib.dll + + + CP0012 + M:System.Delegate.CombineImpl(System.Delegate) + net10.0/netstandard.dll + net11.0/netstandard.dll + + + CP0012 + M:System.Delegate.GetInvocationList + net10.0/netstandard.dll + net11.0/netstandard.dll + + + CP0012 + M:System.Delegate.RemoveImpl(System.Delegate) + net10.0/netstandard.dll + net11.0/netstandard.dll + + + CP0012 + M:System.Delegate.CombineImpl(System.Delegate) + net10.0/System.Runtime.dll + net11.0/System.Runtime.dll + + + CP0012 + M:System.Delegate.GetInvocationList + net10.0/System.Runtime.dll + net11.0/System.Runtime.dll + + + CP0012 + M:System.Delegate.RemoveImpl(System.Delegate) + net10.0/System.Runtime.dll + net11.0/System.Runtime.dll + CP0014 M:System.Security.Cryptography.X509Certificates.PublicKey.#ctor(System.Security.Cryptography.MLDsa):[T:System.Diagnostics.CodeAnalysis.ExperimentalAttribute] diff --git a/src/libraries/apicompat/ApiCompatBaseline.netstandard2.0.xml b/src/libraries/apicompat/ApiCompatBaseline.netstandard2.0.xml index ff617479e36ec1..e33c2d47f78f67 100644 --- a/src/libraries/apicompat/ApiCompatBaseline.netstandard2.0.xml +++ b/src/libraries/apicompat/ApiCompatBaseline.netstandard2.0.xml @@ -7,30 +7,6 @@ netstandard2.0/System.ComponentModel.Composition.dll right - - CP0002 - M:System.Delegate.CombineImpl(System.Delegate) - netstandard2.0/mscorlib.dll - net11.0/mscorlib.dll - - - CP0002 - M:System.Delegate.DynamicInvokeImpl(System.Object[]) - netstandard2.0/mscorlib.dll - net11.0/mscorlib.dll - - - CP0002 - M:System.Delegate.GetMethodImpl - netstandard2.0/mscorlib.dll - net11.0/mscorlib.dll - - - CP0002 - M:System.Delegate.RemoveImpl(System.Delegate) - netstandard2.0/mscorlib.dll - net11.0/mscorlib.dll - CP0002 M:System.ComponentModel.BaseNumberConverter.#ctor @@ -61,30 +37,6 @@ netstandard2.0/netstandard.dll net11.0/netstandard.dll - - CP0002 - M:System.Delegate.CombineImpl(System.Delegate) - netstandard2.0/netstandard.dll - net11.0/netstandard.dll - - - CP0002 - M:System.Delegate.DynamicInvokeImpl(System.Object[]) - netstandard2.0/netstandard.dll - net11.0/netstandard.dll - - - CP0002 - M:System.Delegate.GetMethodImpl - netstandard2.0/netstandard.dll - net11.0/netstandard.dll - - - CP0002 - M:System.Delegate.RemoveImpl(System.Delegate) - netstandard2.0/netstandard.dll - net11.0/netstandard.dll - CP0002 M:System.Linq.EnumerableExecutor.#ctor @@ -169,30 +121,6 @@ netstandard2.0/System.Linq.Queryable.dll net11.0/System.Linq.Queryable.dll - - CP0002 - M:System.Delegate.CombineImpl(System.Delegate) - netstandard2.0/System.Runtime.dll - net11.0/System.Runtime.dll - - - CP0002 - M:System.Delegate.DynamicInvokeImpl(System.Object[]) - netstandard2.0/System.Runtime.dll - net11.0/System.Runtime.dll - - - CP0002 - M:System.Delegate.GetMethodImpl - netstandard2.0/System.Runtime.dll - net11.0/System.Runtime.dll - - - CP0002 - M:System.Delegate.RemoveImpl(System.Delegate) - netstandard2.0/System.Runtime.dll - net11.0/System.Runtime.dll - CP0002 M:System.Xml.Schema.XmlSchemaDatatype.#ctor @@ -301,6 +229,60 @@ netstandard2.0/System.Xml.dll net11.0/System.Xml.dll + + CP0012 + M:System.Delegate.CombineImpl(System.Delegate) + netstandard2.0/mscorlib.dll + net11.0/mscorlib.dll + + + CP0012 + M:System.Delegate.GetInvocationList + netstandard2.0/mscorlib.dll + net11.0/mscorlib.dll + + + CP0012 + M:System.Delegate.RemoveImpl(System.Delegate) + netstandard2.0/mscorlib.dll + net11.0/mscorlib.dll + + + CP0012 + M:System.Delegate.CombineImpl(System.Delegate) + netstandard2.0/netstandard.dll + net11.0/netstandard.dll + + + CP0012 + M:System.Delegate.GetInvocationList + netstandard2.0/netstandard.dll + net11.0/netstandard.dll + + + CP0012 + M:System.Delegate.RemoveImpl(System.Delegate) + netstandard2.0/netstandard.dll + net11.0/netstandard.dll + + + CP0012 + M:System.Delegate.CombineImpl(System.Delegate) + netstandard2.0/System.Runtime.dll + net11.0/System.Runtime.dll + + + CP0012 + M:System.Delegate.GetInvocationList + netstandard2.0/System.Runtime.dll + net11.0/System.Runtime.dll + + + CP0012 + M:System.Delegate.RemoveImpl(System.Delegate) + netstandard2.0/System.Runtime.dll + net11.0/System.Runtime.dll + CP0014 M:System.Collections.IEnumerable.GetEnumerator:[T:System.Runtime.InteropServices.DispIdAttribute] diff --git a/src/libraries/apicompat/ApiCompatBaseline.netstandard2.1.xml b/src/libraries/apicompat/ApiCompatBaseline.netstandard2.1.xml index 30b14fb37d5829..3c2c66c349e466 100644 --- a/src/libraries/apicompat/ApiCompatBaseline.netstandard2.1.xml +++ b/src/libraries/apicompat/ApiCompatBaseline.netstandard2.1.xml @@ -2,25 +2,19 @@ - CP0002 + CP0012 M:System.Delegate.CombineImpl(System.Delegate) netstandard2.1/netstandard.dll net11.0/netstandard.dll - CP0002 - M:System.Delegate.DynamicInvokeImpl(System.Object[]) + CP0012 + M:System.Delegate.GetInvocationList netstandard2.1/netstandard.dll net11.0/netstandard.dll - CP0002 - M:System.Delegate.GetMethodImpl - netstandard2.1/netstandard.dll - net11.0/netstandard.dll - - - CP0002 + CP0012 M:System.Delegate.RemoveImpl(System.Delegate) netstandard2.1/netstandard.dll net11.0/netstandard.dll diff --git a/src/mono/System.Private.CoreLib/src/System/Delegate.Mono.cs b/src/mono/System.Private.CoreLib/src/System/Delegate.Mono.cs index 12dcc7886f38af..de3120dac128f2 100644 --- a/src/mono/System.Private.CoreLib/src/System/Delegate.Mono.cs +++ b/src/mono/System.Private.CoreLib/src/System/Delegate.Mono.cs @@ -423,7 +423,7 @@ private static bool IsArgumentTypeMatchWithThis(Type delArgType, Type argType, b return match; } - internal object? DynamicInvokeImpl(object?[]? args) + protected virtual object? DynamicInvokeImpl(object?[]? args) { MethodInfo method = Method; @@ -518,7 +518,7 @@ public override int GetHashCode() return (m != null ? m.GetHashCode() : GetType().GetHashCode()) ^ RuntimeHelpers.GetHashCode(_target); } - internal MethodInfo GetMethodImpl() + protected virtual MethodInfo GetMethodImpl() { if (method_info != null) return method_info; diff --git a/src/mono/System.Private.CoreLib/src/System/MulticastDelegate.Mono.cs b/src/mono/System.Private.CoreLib/src/System/MulticastDelegate.Mono.cs index 3f7b826c15470e..c026cf46a88539 100644 --- a/src/mono/System.Private.CoreLib/src/System/MulticastDelegate.Mono.cs +++ b/src/mono/System.Private.CoreLib/src/System/MulticastDelegate.Mono.cs @@ -21,7 +21,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont throw new SerializationException(SR.Serialization_DelegatesNotSupported); } - internal new object? DynamicInvokeImpl(object?[]? args) + protected sealed override object? DynamicInvokeImpl(object?[]? args) { if (delegates == null) { @@ -82,7 +82,7 @@ public sealed override int GetHashCode() return base.GetHashCode(); } - internal new MethodInfo GetMethodImpl() + protected override MethodInfo GetMethodImpl() { if (delegates != null) return delegates[delegates.Length - 1].Method; @@ -94,7 +94,7 @@ public sealed override int GetHashCode() // Return, in order of invocation, the invocation list // of a MulticastDelegate // - public sealed override Delegate[] GetInvocationList() + internal new Delegate[] GetInvocationList() { if (delegates != null) return (Delegate[])delegates.Clone(); @@ -126,7 +126,7 @@ public sealed override Delegate[] GetInvocationList() // thing should have better been a simple System.Delegate class. // Compiler generated delegates are always MulticastDelegates. // - internal Delegate CombineImpl(Delegate? follow) + internal new Delegate CombineImpl(Delegate? follow) { if (follow == null) return this; @@ -197,7 +197,7 @@ private static int LastIndexOf(Delegate[] haystack, Delegate[] needle) return -1; } - internal Delegate? RemoveImpl(Delegate? value) + internal new Delegate? RemoveImpl(Delegate? value) { if (value == null) return this; From 194f928af76c927c98c12ac1299521de38feeb0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Petryka?= Date: Tue, 23 Jun 2026 01:26:00 +0200 Subject: [PATCH 8/8] Revert suppressions --- .../CompatibilitySuppressions.xml | 4 +- .../src/CompatibilitySuppressions.xml | 64 ++++++------------- .../src/CompatibilitySuppressions.xml | 3 +- .../src/CompatibilitySuppressions.xml | 2 +- .../src/CompatibilitySuppressions.xml | 2 +- .../src/CompatibilitySuppressions.xml | 2 +- .../src/CompatibilitySuppressions.xml | 4 +- 7 files changed, 27 insertions(+), 54 deletions(-) diff --git a/src/coreclr/System.Private.CoreLib/CompatibilitySuppressions.xml b/src/coreclr/System.Private.CoreLib/CompatibilitySuppressions.xml index 17dfc127110220..141210a166bc8f 100644 --- a/src/coreclr/System.Private.CoreLib/CompatibilitySuppressions.xml +++ b/src/coreclr/System.Private.CoreLib/CompatibilitySuppressions.xml @@ -1,4 +1,4 @@ - + @@ -29,4 +29,4 @@ CP0008 T:System.Collections.BitArray - \ No newline at end of file + diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/CompatibilitySuppressions.xml b/src/coreclr/nativeaot/System.Private.CoreLib/src/CompatibilitySuppressions.xml index 665cee998ca125..b85912e6cf1ff0 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/CompatibilitySuppressions.xml +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/CompatibilitySuppressions.xml @@ -1,10 +1,6 @@ - + - - CP0001 - T:Internal.Console - CP0001 T:Internal.Metadata.NativeFormat.ArraySignature @@ -57,6 +53,14 @@ CP0001 T:Internal.Metadata.NativeFormat.ConstantBooleanValueHandle + + CP0001 + T:Internal.Metadata.NativeFormat.ConstantEnumValue + + + CP0001 + T:Internal.Metadata.NativeFormat.ConstantEnumValueHandle + CP0001 T:Internal.Metadata.NativeFormat.ConstantByteArray @@ -113,14 +117,6 @@ CP0001 T:Internal.Metadata.NativeFormat.ConstantEnumArrayHandle - - CP0001 - T:Internal.Metadata.NativeFormat.ConstantEnumValue - - - CP0001 - T:Internal.Metadata.NativeFormat.ConstantEnumValueHandle - CP0001 T:Internal.Metadata.NativeFormat.ConstantHandleArray @@ -657,10 +653,6 @@ CP0001 T:Internal.Metadata.NativeFormat.UInt64Collection - - CP0001 - T:Internal.NativeFormat.TypeHashingAlgorithms - CP0001 T:Internal.Reflection.Core.AssemblyBinder @@ -733,10 +725,6 @@ CP0001 T:Internal.TypeSystem.LockFreeReaderHashtable`2 - - CP0001 - T:Internal.TypeSystem.LockFreeReaderHashtableOfPointers`2 - CP0001 T:System.Diagnostics.DebugAnnotations @@ -747,11 +735,11 @@ CP0001 - T:System.FieldHandleInfo + T:System.MDArray CP0001 - T:System.MDArray + T:System.FieldHandleInfo CP0001 @@ -818,16 +806,8 @@ T:System.Runtime.CompilerServices.StaticClassConstructionContext - CP0002 - F:System.Resources.ResourceManager.BaseNameField - - - CP0002 - F:System.Resources.ResourceSet.Reader - - - CP0002 - M:System.Diagnostics.DiagnosticMethodInfo.#ctor(System.String,System.String,System.String) + CP0001 + T:Internal.TypeSystem.LockFreeReaderHashtableOfPointers`2 CP0002 @@ -835,22 +815,14 @@ CP0002 - M:System.String.Trim(System.ReadOnlySpan{System.Char}) - - - CP0002 - M:System.String.TrimEnd(System.ReadOnlySpan{System.Char}) - - - CP0002 - M:System.String.TrimStart(System.ReadOnlySpan{System.Char}) + M:System.Threading.Lock.#ctor(System.Boolean) CP0002 - M:System.Threading.Lock.#ctor(System.Boolean) + M:System.Diagnostics.DiagnosticMethodInfo.#ctor(System.String,System.String,System.String) - CP0008 - T:System.Collections.BitArray + CP0001 + T:Internal.NativeFormat.TypeHashingAlgorithms - \ No newline at end of file + diff --git a/src/libraries/System.Collections.Specialized/src/CompatibilitySuppressions.xml b/src/libraries/System.Collections.Specialized/src/CompatibilitySuppressions.xml index 9ca61f831d39df..d6c64b01d2cd7a 100644 --- a/src/libraries/System.Collections.Specialized/src/CompatibilitySuppressions.xml +++ b/src/libraries/System.Collections.Specialized/src/CompatibilitySuppressions.xml @@ -1,6 +1,7 @@ - + + CP0001 T:System.Collections.Specialized.ListDictionary.DictionaryNode diff --git a/src/libraries/System.Collections/src/CompatibilitySuppressions.xml b/src/libraries/System.Collections/src/CompatibilitySuppressions.xml index bac766f06ed6b5..52276bd955eb14 100644 --- a/src/libraries/System.Collections/src/CompatibilitySuppressions.xml +++ b/src/libraries/System.Collections/src/CompatibilitySuppressions.xml @@ -1,4 +1,4 @@ - + diff --git a/src/libraries/System.Linq.Expressions/src/CompatibilitySuppressions.xml b/src/libraries/System.Linq.Expressions/src/CompatibilitySuppressions.xml index 02d0150a0d431b..739e336d8b4cad 100644 --- a/src/libraries/System.Linq.Expressions/src/CompatibilitySuppressions.xml +++ b/src/libraries/System.Linq.Expressions/src/CompatibilitySuppressions.xml @@ -1,4 +1,4 @@ - + diff --git a/src/libraries/System.Runtime.InteropServices/src/CompatibilitySuppressions.xml b/src/libraries/System.Runtime.InteropServices/src/CompatibilitySuppressions.xml index 7d38f8a49e7657..da3c19b3810459 100644 --- a/src/libraries/System.Runtime.InteropServices/src/CompatibilitySuppressions.xml +++ b/src/libraries/System.Runtime.InteropServices/src/CompatibilitySuppressions.xml @@ -1,4 +1,4 @@ - + diff --git a/src/libraries/System.Runtime/src/CompatibilitySuppressions.xml b/src/libraries/System.Runtime/src/CompatibilitySuppressions.xml index d4d76a349c60bd..8d6cd745858ae4 100644 --- a/src/libraries/System.Runtime/src/CompatibilitySuppressions.xml +++ b/src/libraries/System.Runtime/src/CompatibilitySuppressions.xml @@ -1,4 +1,4 @@ - + @@ -13,4 +13,4 @@ CP0002 M:System.Runtime.Serialization.SerializationInfo.StartDeserialization - \ No newline at end of file +