Skip to content

Instantly share code, notes, and snippets.

@jnm2
Created January 27, 2023 19:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jnm2/4f711dca321ccc268154f8393d556af8 to your computer and use it in GitHub Desktop.
Save jnm2/4f711dca321ccc268154f8393d556af8 to your computer and use it in GitHub Desktop.
#if !NET7_0_OR_GREATER
namespace System.Runtime.CompilerServices;
#endif
#if !NET5_0_OR_GREATER
internal static class IsExternalInit { }
#endif
#if !NET7_0_OR_GREATER
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Struct, Inherited = false)]
internal sealed class RequiredMemberAttribute : Attribute { }
[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = false)]
internal sealed class CompilerFeatureRequiredAttribute : Attribute
{
public CompilerFeatureRequiredAttribute(string featureName) => FeatureName = featureName;
public string FeatureName { get; }
public bool IsOptional { get; init; }
public const string RefStructs = nameof(RefStructs);
public const string RequiredMembers = nameof(RequiredMembers);
}
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment