dotnet / dotnet/csharpstandard
12.16.6.3 Highlight the difference between a for loop and a foreach loop
Open
type: clarity
- Dominant language
- C#
- Stars
- 815
- Forks
- 99
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 16
Description
We've already mentioned this elsewhere in the spec, but as 13.16.6.3 explicitly notes that an iteration variable declared by a `for` loop is effectively declared outside the loop, I think it would be worth reiterating here that a foreach iteration variable is different, with an example.
Contributor guide
Assessment
This issue has not been assessed yet.