Skip to content

Commit 32a57c5

Browse files
authored
Add ByRefLikeGenerics to runtime features (#250)
***NO_CI***
1 parent ed90c8e commit 32a57c5

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

nanoFramework.CoreLibrary/System/Runtime/CompilerServices/RuntimeFeature.cs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
namespace System.Runtime.CompilerServices
@@ -13,17 +13,22 @@ public static partial class RuntimeFeature
1313
/// </summary>
1414
public const string DefaultImplementationsOfInterfaces = nameof(DefaultImplementationsOfInterfaces);
1515

16+
/// <summary>
17+
/// Represents a runtime feature where byref-like types can be used in Generic parameters.
18+
/// </summary>
19+
public const string ByRefLikeGenerics = nameof(ByRefLikeGenerics);
20+
1621
/// <summary>
1722
/// Checks whether a certain feature is supported by the Runtime.
1823
/// </summary>
1924
public static bool IsSupported(string feature)
2025
{
21-
if (feature == DefaultImplementationsOfInterfaces)
26+
return feature switch
2227
{
23-
return true;
24-
}
25-
26-
return false;
28+
ByRefLikeGenerics or
29+
DefaultImplementationsOfInterfaces => true,
30+
_ => false,
31+
};
2732
}
2833
}
2934
}

0 commit comments

Comments
 (0)