digitalmars.D.bugs - wrong function overload
- Karen Lanrap (19/19) Sep 27 2006 import std.stdio;
- Thomas Kuehne (15/34) Sep 29 2006 -----BEGIN PGP SIGNED MESSAGE-----
import std.stdio; enum COLOR{RED}; enum TYPE{SOFT_TOP}; class Car{ int val; void roof( COLOR c) { val= 1; } void roof(TYPE t, int i) { val= 2; } } void main(){ auto mycar= new Car; mycar.roof( TYPE.SOFT_TOP); // should not compile writefln( mycar.val); // should print 2 }
Sep 27 2006
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Karen Lanrap schrieb am 2006-09-27:import std.stdio; enum COLOR{RED}; enum TYPE{SOFT_TOP}; class Car{ int val; void roof( COLOR c) { val= 1; } void roof(TYPE t, int i) { val= 2; } } void main(){ auto mycar= new Car; mycar.roof( TYPE.SOFT_TOP); // should not compile writefln( mycar.val); // should print 2 }Added to DStress as http://dstres.kuehne.cn/nocompile/e/enum_50_A.d http://dstres.kuehne.cn/nocompile/e/enum_50_B.d http://dstres.kuehne.cn/nocompile/e/enum_50_C.d http://dstres.kuehne.cn/nocompile/e/enum_50_D.d http://dstres.kuehne.cn/nocompile/e/enum_50_E.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFFHMrsLK5blCcjpWoRAmTnAJ4hndbSLVzzv6QhD1UU8Yfvtx9eAwCfewI0 4P79FCUiddUz8QLhQGMN4Ao= =cw8D -----END PGP SIGNATURE-----
Sep 29 2006