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 4bb3b134d0875..2630e0f2c1b7b 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 @@ -1,6 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Runtime.Versioning; + namespace System.Runtime.CompilerServices { public static partial class RuntimeFeature @@ -25,6 +27,12 @@ public static partial class RuntimeFeature /// public const string CovariantReturnsOfClasses = nameof(CovariantReturnsOfClasses); + /// + /// Indicates that this version of runtime supports virtual static members of interfaces. + /// + [RequiresPreviewFeatures] + public const string VirtualStaticsInInterfaces = nameof(VirtualStaticsInInterfaces); + /// /// Checks whether a certain feature is supported by the Runtime. /// @@ -36,6 +44,7 @@ public static bool IsSupported(string feature) case CovariantReturnsOfClasses: case UnmanagedSignatureCallingConvention: case DefaultImplementationsOfInterfaces: + case VirtualStaticsInInterfaces: return true; case nameof(IsDynamicCodeSupported): return IsDynamicCodeSupported; diff --git a/src/libraries/System.Runtime/ref/System.Runtime.cs b/src/libraries/System.Runtime/ref/System.Runtime.cs index 5a63970ad62e1..1594290fd3bc5 100644 --- a/src/libraries/System.Runtime/ref/System.Runtime.cs +++ b/src/libraries/System.Runtime/ref/System.Runtime.cs @@ -9766,6 +9766,8 @@ public static partial class RuntimeFeature public const string DefaultImplementationsOfInterfaces = "DefaultImplementationsOfInterfaces"; public const string UnmanagedSignatureCallingConvention = "UnmanagedSignatureCallingConvention"; public const string PortablePdb = "PortablePdb"; + [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute] + public const string VirtualStaticsInInterfaces = "VirtualStaticsInInterfaces"; public static bool IsDynamicCodeCompiled { get { throw null; } } public static bool IsDynamicCodeSupported { get { throw null; } } public static bool IsSupported(string feature) { throw null; }