dotnet / dotnet/csharpstandard
Review whether there needs to be some syncing up between §11.2.2 and §9.2.9 *Local variables*, §9.4 *Definite assignment*
- Dominant language
- C#
- Stars
- 815
- Forks
- 99
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 16
Description
This [comment in #873](https://github.com/dotnet/csharpstandard/pull/873#discussion_r2366396417), which follows the one quoted below, is part of this issue as well.
---
I think there probably needs to be some syncing up between here and §9.2.9 *Local variables*, §9.4 *Definite assignment*, including the lifetime & scope of the variable – hardly anything is stated about these here:
- Line 90 below states the variable is assigned on a match
- **Informatively** line 121 states for the example that after the `if` the variable is in scope but not definitely assigned, there is no `else` in the example so the definite assignment status there is not covered.
_Originally posted by @Nigel-Ecma in https://github.com/dotnet/csharpstandard/pull/873#discussion_r2366395973_
Contributor guide
Assessment
This issue has not been assessed yet.