dotnet / csharpstandard

Working space for ECMA-TC49-TG2, the C# standard committee.
Creative Commons Attribution 4.0 International
715 stars 84 forks source link

C# 7 §13.10.5 (The return statement) wrongly references §10.5 (User-defined conversions) #827

Closed KalleOlaviNiemitalo closed 1 year ago

KalleOlaviNiemitalo commented 1 year ago

Describe the bug

In the C# 7 draft, §13.10.5 (Statements / Jump statements / The return statement) contains this text:

The return statement returns control to the current caller of the function member in which the return statement appears, optionally returning a value or a variable_reference (§10.5).

but §10.5 (Conversions / User-defined conversions) does not describe _variablereference.

Example

Not applicable.

Expected behavior

The reference should be to §9.5 (Variables / Variable references), instead.

Additional context

The reference to §10.5 was already incorrect when it was added in https://github.com/dotnet/csharpstandard/commit/2565ad2debc9726360b9959a677ea85d4fd2a484; the mismatch was not caused by any subsequent renumbering. I don't think it is necessary to check the other references that came to draft-v7 via https://github.com/dotnet/csharpstandard/pull/213 and https://github.com/dotnet/csharpstandard/pull/795.

Nigel-Ecma commented 1 year ago

Added PR #829 to fix this typo.