-
Notifications
You must be signed in to change notification settings - Fork 92
Description
Pattern, deconstruction expressions and out variables all allow for local variables to be declared in places that are not accounted for by existing scope rules. In addition, those locations allow for the use of discards in lieu of existing or fresh variables.
Currently the treatment of these variables is spread out and partially duplicated across #61, #63 and #44. I think there's both an opportunity and a need for unifying this treatment, quite possibly introducing new concepts/terms in the process.
Perhaps the best approach is to treat this as a separate "feature" with its own PR, which the above PRs can then build on. The "feature" introduces new concepts (e.g. discards), scope rules etc. but does not in and of itself surface them in syntax.