-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
75 additions
and
14 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
src/Jab.FunctionalTests.Common/CompilerFeatureRequiredAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace System.Runtime.CompilerServices | ||
{ | ||
/// <summary> | ||
/// Indicates that compiler support for a particular feature is required for the location where this attribute is applied. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = false)] | ||
public sealed class CompilerFeatureRequiredAttribute : Attribute | ||
{ | ||
public CompilerFeatureRequiredAttribute(string featureName) | ||
{ | ||
FeatureName = featureName; | ||
} | ||
|
||
/// <summary> | ||
/// The name of the compiler feature. | ||
/// </summary> | ||
public string FeatureName { get; } | ||
|
||
/// <summary> | ||
/// If true, the compiler can choose to allow access to the location where this attribute is applied if it does not understand <see cref="FeatureName"/>. | ||
/// </summary> | ||
public bool IsOptional { get; init; } | ||
|
||
/// <summary> | ||
/// The <see cref="FeatureName"/> used for the ref structs C# feature. | ||
/// </summary> | ||
public const string RefStructs = nameof(RefStructs); | ||
|
||
/// <summary> | ||
/// The <see cref="FeatureName"/> used for the required members C# feature. | ||
/// </summary> | ||
public const string RequiredMembers = nameof(RequiredMembers); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
using System.ComponentModel; | ||
namespace System.Runtime.CompilerServices | ||
{ | ||
/// <summary>Specifies that a type has required members or that a member is required.</summary> | ||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)] | ||
[EditorBrowsable(EditorBrowsableState.Never)] | ||
#if SYSTEM_PRIVATE_CORELIB | ||
public | ||
#else | ||
internal | ||
#endif | ||
sealed class RequiredMemberAttribute : Attribute | ||
{ } | ||
} |