new A().b() currently requires extra brackets/parentheses

Andrej Mitrovic andrej.mitrovich at gmail.com
Mon Sep 10 14:00:05 PDT 2012


On 9/10/12, Sönke Ludwig <sludwig at outerproduct.org> wrote:
> Of course it's not a type... but A.B is. It's also not that important,
> but it feels slightly inconsistent and coincidential that the clamps are
> used here to separate the new expression from the rest.

It prevents ambiguity and hijacking.

If 'x' of B ends up being a type or an alias of a type you'll end up
instantiating something else instead of the B class.


More information about the Digitalmars-d mailing list