braceless with statements

Ogi ogion.art at gmail.com
Sun Nov 14 17:39:54 UTC 2021


On Sunday, 14 November 2021 at 16:51:01 UTC, kdevel wrote:
>Wrong: replace /* lots of code here */ with int x:

Hmm, it works indeed. Not sure if that’s intended, since the 
other way around is prohibited:

```D
struct S { int x; }
void main ()
{
    S s;
    int x;
    with (s) {
       x = 42; //Error: with symbol `onlineapp.S.x` is shadowing 
local symbol `onlineapp.main.x`
    }
}
```



More information about the Digitalmars-d mailing list