On Monday, 14 May 2018 at 11:53:44 UTC, Nick Treleaven wrote:
On Monday, 14 May 2018 at 01:20:38 UTC, Jonathan M Davis wrote:
Yeah. It's been discussed that it should be illegal to declare a struct or class member named init, but that change has yet to happen.

https://issues.dlang.org/show_bug.cgi?id=7066

Walter and Timon have considered redefinition potentially useful. A compromise would be to require `init` and `stringof` to be `static`. That would probably prevent the accidental conflicts that arise with `init`.

Well, Walter mentioned that "so far [no use cases] have materialized" in 2012, and I don't think that has changed since.

@disabling .init might be an exception – although one that flirts with grey areas in the language definition –, but that could still be supported while providing useful diagnostics for other uses.

 — David

Reply via email to