Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename LifetimeAnnotationAttribute to ScopedRefAttribute and remove unnecessary members #62838

Closed
cston opened this issue Jul 21, 2022 · 4 comments
Assignees
Labels
4 - In Review A fix for the issue is submitted for review. Area-Compilers Bug Feature - Ref Fields
Milestone

Comments

@cston
Copy link
Member

cston commented Jul 21, 2022

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

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Jul 21, 2022
@cston
Copy link
Member Author

cston commented Jul 21, 2022

cc @jaredpar, @jcouv

@cston cston added this to the 17.4 milestone Jul 21, 2022
@Sergio0694
Copy link
Contributor

Nit: I assume the name should be [ScopedRef] for consistency (like the title says), but the proposal says [Scoped] 😄

@cston
Copy link
Member Author

cston commented Jul 21, 2022

Thanks @Sergio0694. Updated.

@teo-tsirpanis
Copy link
Contributor

@jcouv should #63009 have closed this?

@jcouv jcouv closed this as completed Aug 3, 2022
@jcouv jcouv moved this to Active/Investigating in Compiler: Julien's umbrellas Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - In Review A fix for the issue is submitted for review. Area-Compilers Bug Feature - Ref Fields
Projects
Archived in project
Development

No branches or pull requests

4 participants