Skip to content

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

@gafter

Description

@gafter

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions