Skip to content

Conversation

Rekkonnect
Copy link
Contributor

@Rekkonnect Rekkonnect commented Aug 17, 2023

This draft PR is approved by @CyrusNajmabadi in offline conversations. Feature and PR review is not expected to happen before the release of C# 12.

The feature's spec is dotnet/csharplang#7352

Currently handled

Features

  • Syntax parsing
  • Variable assignment
  • Direct return in method body
  • Direct assignment to the ref
  • Direct compound assignment to the ref
  • Ref and value escaping based on scope
  • Readonly ref kind

Handy features

  • IDE suggestions for ref within arms
    • Always suggest ref, even when the switch expression does not have a ref on the left of it
    • This already works, this PR does not need to address this

Errors

  • Not using ref returned from the expression
  • Not all arms have ref or throw
  • C# preview required
  • ref on switch expression not returning ref (better hint about the feature)

@ghost ghost added Community The pull request was submitted by a contributor who is not a Microsoft employee. Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Compilers Community The pull request was submitted by a contributor who is not a Microsoft employee. untriaged Issues and PRs which have not yet been triaged by a lead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant