Skip to content

Rename LifetimeAnnotationAttribute to ScopedRefAttribute and remove unnecessary members #62838

@cston

Description

@cston

The LifetimeAnnotationAttribute synthesized by the compiler for scoped should be renamed to align with the corresponding runtime attribute for unscoped (see dotnet/runtime#72074).

And the IsRefScoped and IsValueScoped properties are unnecessary and can be removed because that can be determined based on whether the parameter is passed by reference or by value.

The updated synthesized attribute API:

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

Spec change: dotnet/csharplang#6325

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Active/Investigating

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions