Skip to content

API Proposal: Add ref field feature support to RuntimeFeature class #64165

@AaronRobinsonMSFT

Description

@AaronRobinsonMSFT

Background and motivation

This is desired to help Roslyn perform down-level targeting for the ref field support added in #63768.

API Proposal

Implementation PR at #64167.

namespace System.Runtime.CompilerServices
{
    public static partial class RuntimeFeature
    {
+        /// <summary>
+        /// Represents a runtime feature where types can define ref fields.
+        /// </summary>
+        public const string ByRefFields = nameof(ByRefFields);
    }
}

API Usage

Used by Roslyn to detect if a runtime supports ref fields.

Alternative Designs

This is the typical way to indicate a feature to Roslyn.

Risks

None.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions