D supports : as an indicator to create a scope up to the end of the enclosing scope.
This does not work for this:
with(Foo): // Error: found ':' instead of statement
If there is no specific reason for this to not work, then it should be supported.
Comment #1 by ketmar — 2015-03-25T04:06:20Z
where in specs ':' is specified as scope start?
Comment #2 by blah38621 — 2015-03-25T05:41:36Z
Going by that same definition, wouldn't:
if (true):
else:
foreach (v; arr):
etc. also be allowed? I don't believe this should be the case.
Comment #3 by deadalnix — 2015-03-26T20:33:05Z
if/else/while actually DO something.
With simply change the identifier resolution rules. In fact, thinking about it, it should even be required that with is a statement.
Comment #4 by robert.schadek — 2024-12-13T18:41:26Z