`with` across function calls
Nicholas Wilson
iamthewilsonator at hotmail.com
Fri Jan 18 14:48:22 UTC 2019
On Friday, 18 January 2019 at 14:29:59 UTC, Simen Kjærås wrote:
> If my intuition is correct, the above should compile with no
> asserts triggered.
Yes.
> I further expect that attempting to call bar() or qux() outside
> a with(g) will fail:
>
> unittest {
> bar(); // Error: calling bar requires Global g in
> surrounding with() scope.
> Global g;
> bar(); // Error: Global g found in surrounding scope, but
> not used in with().
> }
Correct.
More information about the Digitalmars-d
mailing list