However, there are valid reasons why a user might want to treat other ( )-enclosed code blocks (e.g, the body of a user-defined function) like scopes.
Details
Repro is with Zed commit f1be6a4.
5073 has the background for the equivalent concept as relates to user-defined operators. It seems a similar enhancement might benefit user-defined functions as well. For example, this currently works:
tl;dr
In the Zed docs about statements several times we explain scopes as:
However, there are valid reasons why a user might want to treat other
( )
-enclosed code blocks (e.g, the body of a user-defined function) like scopes.Details
Repro is with Zed commit f1be6a4.
5073 has the background for the equivalent concept as relates to user-defined operators. It seems a similar enhancement might benefit user-defined functions as well. For example, this currently works:
But this does not: