On Thursday, 14 April 2022 at 08:55:25 UTC, Chris Katko wrote:
Using DMD. v2.098-beta-2Not sure if right terminology. But I just wrote a nested function that uses a variable outside its body. The capture (right term?) is obvious where the invocation is. However, I have to move the declaration of the variable to above the nested function for it to compile.
Declarations in function scope are processed in order. This includes nested functions:
https://dlang.org/spec/function.html#nested (see #8).