Struct constructor and opCall confussion

Jonathan M Davis jmdavisProg at gmx.com
Mon Mar 7 15:41:19 PST 2011


On Monday, March 07, 2011 11:24:52 Tom wrote:
> D2 Code:
> 
> int main(string[] args) {
> 
> 	struct S {
> 		int i;
> 		this(int i) { this.i = i; }
> 		void opCall(int x, int y) { }
> 	}
> 
> 	S s;
> 	s(4, 1);
> 
> 	return 0;
> }
> 
> src\main.d(12): Error: constructor main.main.S.this (int i) is not
> callable using argument types (int,int)
> src\main.d(12): Error: expected 1 arguments, not 2 for non-variadic
> function type ref S(int i)
> 
> 
> Am I missing something or is this another major bug?
> 
> T.I.A.,
> Tom;

I'd say that that's a bug.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list