November 14, 2021

On 11/14/21 12:39 PM, Ogi wrote:

>

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:

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`
    }
}

Yes, it's intended.

I do get your point, but I don't think it's any more confusing than normal with.

-Steve

November 15, 2021
On Friday, 12 November 2021 at 13:01:15 UTC, Timon Gehr wrote:
> On 12.11.21 11:55, Stefan Koch wrote:
>> 
>> It is a really simple patch and I think it's worthwhile to have this in the main language.
>
> Yes, please.

I'll leave it in this PR: https://github.com/dlang/dmd/pull/13305

1 2 3 4
Next ›   Last »