/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Dependencies/Contracts/CompilerFeatureRequiredAttribute.cs
55 строк
2 KB
Tomáš Matoušek
Source package fixes (#78534)
09 май 2025, 23:25
Не верифицирован
09 май 2025, 23:25
0899e12
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable enable // Copied from: // https://github.com/dotnet/runtime/blob/fdd104ec5e1d0d2aa24a6723995a98d0124f724b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/CompilerFeatureRequiredAttribute.cs #if NET8_0_OR_GREATER using System.Runtime.CompilerServices; #pragma warning disable RS0016 // Add public types and members to the declared API (this is a supporting forwarder for an internal polyfill API) [assembly: TypeForwardedTo(typeof(CompilerFeatureRequiredAttribute))] #pragma warning restore RS0016 // Add public types and members to the declared API #else 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)] internal 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); } } #endif