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
{
}
}
Background and motivation
As part of the new
ref readonlyparameters 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