Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 2083b09

Browse files
Add RuntimeFeature.DefaultImplementationsOfInterfaces (#25943)
The flag indicates that the runtime supports default implementation of interfaces. Since this is a prerelease feature that is not complete yet (and we don't want to accidentally ship it), the flag is keyed off a newly added `IsPrerelease` property. This property is expected to be flipped to `false` in release branches. This corresponds to dotnet/coreclr#15358.
1 parent 1ad9919 commit 2083b09

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

dir.props

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
<IsDotNetFrameworkProductAssembly>true</IsDotNetFrameworkProductAssembly>
2424
</PropertyGroup>
2525

26+
<!-- Indicates this is not an officially supported release. Release branches should set this to false. -->
27+
<PropertyGroup>
28+
<IsPrerelease>true</IsPrerelease>
29+
</PropertyGroup>
30+
2631
<!-- Common repo directories -->
2732
<PropertyGroup>
2833
<ProjectDir>$(MSBuildThisFileDirectory)</ProjectDir>

src/System.Runtime/ref/System.Runtime.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6828,6 +6828,9 @@ public enum LoadHint
68286828
}
68296829
public static class RuntimeFeature
68306830
{
6831+
#if FEATURE_DEFAULT_INTERFACES
6832+
public const string DefaultImplementationsOfInterfaces = nameof(DefaultImplementationsOfInterfaces);
6833+
#endif
68316834
public static bool IsSupported(string feature) { throw null; }
68326835
}
68336836
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]

src/System.Runtime/ref/System.Runtime.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
66
<IsCoreAssembly>true</IsCoreAssembly>
77
<ProjectGuid>{ADBCF120-3454-4A3C-9D1D-AC4293E795D6}</ProjectGuid>
8+
9+
<!-- Default interfaces are not officially supported in netcoreapp yet -->
10+
<DefineConstants Condition="'$(IsPrerelease)' == 'true' and '$(TargetGroup)' == 'netcoreapp'">$(DefineConstants);FEATURE_DEFAULT_INTERFACES</DefineConstants>
11+
812
</PropertyGroup>
913
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Debug|AnyCPU'" />
1014
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Release|AnyCPU'" />

0 commit comments

Comments
 (0)