Skip to content

[API Proposal]: RequiresLocationAttribute (supporting ref readonly parameters) #85910

@Sergio0694

Description

@Sergio0694

Background and motivation

As part of the new ref readonly parameters feature (dotnet/csharplang#6010), Roslyn will emit a new [RequiresLocation] attribute in some cases, all documented in the spec in that linked issue (as well as in the speclet at dotnet/csharplang#7165). This issue tracks adding the attribute to the runtime as well, so it can be shared (just like eg. [RefSafetyRules]).

API Proposal

namespace System.Runtime.CompilerServices
{
    [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
    public sealed class RequiresLocationAttribute : Attribute
    {
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions