From ff53c39a85a16d35dcab6ce5249b02e86f4b76a3 Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Sun, 23 Jan 2022 08:11:18 -0800 Subject: [PATCH 1/3] Add ref field runtime feature indication --- .../src/System/Runtime/CompilerServices/RuntimeFeature.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeFeature.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeFeature.cs index a94a0e19d01761..b4be9135e477b8 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeFeature.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeFeature.cs @@ -27,6 +27,11 @@ public static partial class RuntimeFeature /// public const string CovariantReturnsOfClasses = nameof(CovariantReturnsOfClasses); + /// + /// Indicates that this version of runtime supports ref fields. + /// + public const string RefFields = nameof(RefFields); + /// /// Indicates that this version of runtime supports virtual static members of interfaces. /// @@ -42,6 +47,7 @@ public static bool IsSupported(string feature) { case PortablePdb: case CovariantReturnsOfClasses: + case RefFields: case UnmanagedSignatureCallingConvention: case DefaultImplementationsOfInterfaces: #pragma warning disable CA2252 From 857f4285852e0f403b3c3a0848992092e7016dfc Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Sun, 23 Jan 2022 09:00:09 -0800 Subject: [PATCH 2/3] Change name to follow existing pattern for ByRef concepts. Add new field to ref assembly --- .../src/System/Runtime/CompilerServices/RuntimeFeature.cs | 4 ++-- src/libraries/System.Runtime/ref/System.Runtime.cs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeFeature.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeFeature.cs index b4be9135e477b8..a1c581f60f57dd 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeFeature.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeFeature.cs @@ -30,7 +30,7 @@ public static partial class RuntimeFeature /// /// Indicates that this version of runtime supports ref fields. /// - public const string RefFields = nameof(RefFields); + public const string ByRefFields = nameof(ByRefFields); /// /// Indicates that this version of runtime supports virtual static members of interfaces. @@ -47,7 +47,7 @@ public static bool IsSupported(string feature) { case PortablePdb: case CovariantReturnsOfClasses: - case RefFields: + case ByRefFields: case UnmanagedSignatureCallingConvention: case DefaultImplementationsOfInterfaces: #pragma warning disable CA2252 diff --git a/src/libraries/System.Runtime/ref/System.Runtime.cs b/src/libraries/System.Runtime/ref/System.Runtime.cs index c57c5b13cc1190..8006340a876657 100644 --- a/src/libraries/System.Runtime/ref/System.Runtime.cs +++ b/src/libraries/System.Runtime/ref/System.Runtime.cs @@ -13206,6 +13206,7 @@ public RuntimeCompatibilityAttribute() { } } public static partial class RuntimeFeature { + public const string ByRefFields = "ByRefFields"; public const string CovariantReturnsOfClasses = "CovariantReturnsOfClasses"; public const string DefaultImplementationsOfInterfaces = "DefaultImplementationsOfInterfaces"; public const string PortablePdb = "PortablePdb"; From 3193560092d65357c5d28fc9f0c54a1fc1731a1d Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Mon, 24 Jan 2022 10:27:52 -0500 Subject: [PATCH 3/3] Update src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeFeature.cs Co-authored-by: Stephen Toub --- .../src/System/Runtime/CompilerServices/RuntimeFeature.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeFeature.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeFeature.cs index a1c581f60f57dd..9e0a5ed29e42e8 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeFeature.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeFeature.cs @@ -28,7 +28,7 @@ public static partial class RuntimeFeature public const string CovariantReturnsOfClasses = nameof(CovariantReturnsOfClasses); /// - /// Indicates that this version of runtime supports ref fields. + /// Represents a runtime feature where types can define ref fields. /// public const string ByRefFields = nameof(ByRefFields);