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

ref-safe-to-escape rule for in parameter #296

Closed
gafter opened this issue Jun 14, 2018 · 6 comments · Fixed by #219 or #819
Closed

ref-safe-to-escape rule for in parameter #296

gafter opened this issue Jun 14, 2018 · 6 comments · Fixed by #219 or #819
Assignees
Milestone

Comments

@gafter
Copy link
Member

gafter commented Jun 14, 2018

Looking at

https://github.com/dotnet/csharplang/blob/master/proposals/csharp-7.2/span-safety.md#method-invocation

  • For each in parameter of the method, if there is a corresponding expression that is an lvalue, its ref-safe-to-escape, otherwise the nearest enclosing scope

This is only correct if the argument has an identity conversion to the type of the parameter. For any other type of conversion, I think it should be "nearest enclosing scope" because a copy will be made.


Associated WorkItem - 52211

@gafter
Copy link
Member Author

gafter commented Jun 14, 2018

/cc @OmarTawfik

@BillWagner
Copy link
Member

Moving to dotnet/csharpstandard

@BillWagner BillWagner transferred this issue from dotnet/csharplang Apr 30, 2021
@BillWagner
Copy link
Member

tagging @RexJaeschke as this is in an area you're working on now for C# 7.x

jskeet added a commit to jskeet/csharpstandard that referenced this issue Oct 5, 2021
In particular, request that contributors hold off mentioning
features that aren't in the version we're currently standardising.

We don't want to discourage contributors in general, and if we miss
something we definitely want to know - but having huge numbers of
issues for features we aren't ready to standardize ends up making it
harder to find issues we *do* want to address.

Example issue: dotnet#296 - we'll close that once this change is in.
jskeet added a commit that referenced this issue Oct 6, 2021
In particular, request that contributors hold off mentioning
features that aren't in the version we're currently standardising.

We don't want to discourage contributors in general, and if we miss
something we definitely want to know - but having huge numbers of
issues for features we aren't ready to standardize ends up making it
harder to find issues we *do* want to address.

Example issue: #296 - we'll close that once this change is in.
@jskeet
Copy link
Contributor

jskeet commented Oct 6, 2021

Whoops - the link from PR 381 should have been to issue 269, not this one...

@jskeet
Copy link
Contributor

jskeet commented Jun 5, 2023

This should be fixed by #795.

@jskeet jskeet closed this as completed Jun 5, 2023
@gafter gafter reopened this Jun 5, 2023
@BillWagner
Copy link
Member

The text on Line 1181 in variables.md needs to be clarified.

@BillWagner BillWagner moved this from 🔖 Ready to 🏗 In progress in dotnet/docs June 2023 sprint Jun 21, 2023
BillWagner added a commit to BillWagner/csharpstandard that referenced this issue Jun 21, 2023
The ref safe context for an `in` parameter is different when the `in` argument is passed by reference vs. when a copy is made.

Fixes dotnet#296
@BillWagner BillWagner moved this from 🏗 In progress to 👀 In review in dotnet/docs June 2023 sprint Jun 28, 2023
BillWagner added a commit to BillWagner/csharpstandard that referenced this issue Jul 12, 2023
The ref safe context for an `in` parameter is different when the `in` argument is passed by reference vs. when a copy is made.

Fixes dotnet#296
BillWagner added a commit that referenced this issue Jul 12, 2023
The ref safe context for an `in` parameter is different when the `in` argument is passed by reference vs. when a copy is made.

Fixes #296
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: 🏗 In progress
Status: 🔖 Ready
Status: 👀 In review
3 participants