www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - type inference with variadic ctor bug

reply "John C" <johnch_atms hotmail.com> writes:
class Testing {

    this(int a, ...) { }

}

auto test = new Testing(1, 2, 3);

Results in this error:
constructor Testing.this (int,...) does not match argument types 
(TypeInfo[],int,int).

However, this compiles:

Testing test = new Testing(1, 2, 3); 
Dec 04 2005
parent Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John C schrieb am 2005-12-04:
 class Testing {

     this(int a, ...) { }

 }

 auto test = new Testing(1, 2, 3);

 Results in this error:
 constructor Testing.this (int,...) does not match argument types 
 (TypeInfo[],int,int).

 However, this compiles:

 Testing test = new Testing(1, 2, 3); 
Added to DStress as http://dstress.kuehne.cn/run/v/variadic_argument_11_A.d http://dstress.kuehne.cn/run/v/variadic_argument_11_B.d http://dstress.kuehne.cn/run/v/variadic_argument_11_C.d http://dstress.kuehne.cn/run/v/variadic_argument_11_D.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFDk+2c3w+/yD4P9tIRAko2AJ9GPagEtw1Y8vdLMg2Cr+dIkbuM/gCaAlL5 xB04o5rA5tGDweVVajBlhHA= =tdn/ -----END PGP SIGNATURE-----
Dec 04 2005