Discussion Thread: DIP 1044--Enum Type Inference--Community Review Round 1

Timon Gehr timon.gehr at gmx.ch
Sun Nov 20 21:38:53 UTC 2022


On 20.11.22 22:32, Walter Bright wrote:
> On 11/20/2022 1:56 AM, Timon Gehr wrote:
>> I have somewhat mixed feelings about implicit `with`. On one hand, 
>> it's even more convenient than `$e` `_.e`, `:e` etc, but on the other 
>> hand it's even less predictable for a user where it will work, and it 
>> can shadow variables from outer scopes (which is also a breaking change).
> 
> Consider that we already have implicit with for field access within 
> non-static member functions. I.e. `a` instead of `this.a`. Nobody has 
> complained about it shadowing.

It's in a nested scope, so that's more expected.

> 
> But yes, it would be a (small) breaking change.

Well, I'd be happy to retire some of my with statements.


More information about the Digitalmars-d mailing list