new X().bar(); is a syntax error?

Ary Manzana ary at esperanto.org.ar
Thu Sep 20 09:00:47 PDT 2007


Compiling:

---
class X {
	void bar() {
	}
}

void foo() {
	new X().bar();
}
---

gives me:
main.d(7): found '.' when expecting ';' following 'statement'

Is this a bug or is it the intended behaviour? I can do this in Java, 
C#, probably C++...


More information about the Digitalmars-d-learn mailing list