Discussion Thread: DIP 1043--Shortened Method Syntax--Community Review Round 1
Basile B.
b2.temp at gmx.com
Sat Feb 5 05:08:18 UTC 2022
On Saturday, 5 February 2022 at 00:17:23 UTC, bauss wrote:
> So both these would be valid:
>
> ```d
> void foo() { ... }
> void bar() => foo(); // This
>
> private int _value;
> void baz(int value) => _value = value; // And this
> int baz() => _value;
> ```
Second case works with a void cast:
```d
void baz(int value) => cast(void) (_value = value);
```
More information about the Digitalmars-d
mailing list