-
Notifications
You must be signed in to change notification settings - Fork 478
Closed
Description
As discussed in #210 and #303, it’s not clear from the spec whether a nested block may redefine (“shadow”) a label from one of its ancestors, although the test introduced by #216 makes it unambiguous that this is allowed in practice.
Subjectively, I got the impression from reading the spec that label shadowing is explicitly not allowed, because:
- the production which synthesises an updated identifier context for labels has a side condition which prevents the use of any identifier which already appears in the labels index space of the current context; and
- well-formedness of identifier contexts prevents duplicate identifiers in all index spaces.
I can explain away point 2 by noting that — itself somewhat counterintuitively — well-formedness appears to be asserted only selectively, i.e. in special circumstances where we expect the labels index space to be empty anyway, but I have no explanation for point 1.
It’s entirely possible I’ve misunderstood the spec, but either way, might it be clarified to make the situation more explicit?
Metadata
Metadata
Assignees
Labels
No labels