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

Sönke Ludwig sludwig at outerproduct.org
Mon Sep 10 00:01:55 PDT 2012


Am 09.09.2012 16:43, schrieb Timon Gehr:
> On 09/09/2012 03:28 PM, Timon Gehr wrote:
>> ...
>>
>> I think so. Probably it is just a bug. (the spec does not indicate that
>> it is illegal iirc.)
> 
> I was wrong, the grammar actually precludes this, so it has to be
> changed as well. Anyway, this is the pull request:
> https://github.com/D-Programming-Language/dmd/pull/1111
> 
> 

Does the following also work?

class A {
	static class B {
		int x;
	}
}

new A.B.x = 1;


More information about the Digitalmars-d mailing list