digitalmars.D.bugs - Mixin's adding virtual functions.. conflict
- Regan Heath (33/33) Jun 09 2005 I'm fairly sure this should work.
- Thomas Kuehne (13/45) Jun 11 2005 -----BEGIN PGP SIGNED MESSAGE-----
I'm fairly sure this should work. --[bug7.d.d]-- template readT(T) { void read(out T x) {} } template TReader() { version(good) { void read(out byte x) {} void read(out ubyte x) {} } version(bad) { mixin readT!(byte); mixin readT!(ubyte); } } class A { mixin TReader; } void main(){ A a = new A(); byte b; a.read(b); } C:\Library\D\src\temp>dmd bug7.d -version=good C:\Library\D\dmd\bin\..\..\dm\bin\link.exe bug7,,,user32+kernel32/noi; C:\Library\D\src\temp>dmd bug7.d -version=bad bug7.d(3): function bug7.A.TReader!() TReader_.readT!(byte) readT_g.read conflic ts with bug7.A.TReader!() TReader_.readT!(ubyte) readT_h.read at bug7.d(3) Regan
Jun 09 2005
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Regan Heath schrieb am Fri, 10 Jun 2005 14:09:30 +1200:I'm fairly sure this should work. --[bug7.d.d]-- template readT(T) { void read(out T x) {} } template TReader() { version(good) { void read(out byte x) {} void read(out ubyte x) {} } version(bad) { mixin readT!(byte); mixin readT!(ubyte); } } class A { mixin TReader; } void main(){ A a = new A(); byte b; a.read(b); } C:\Library\D\src\temp>dmd bug7.d -version=good C:\Library\D\dmd\bin\..\..\dm\bin\link.exe bug7,,,user32+kernel32/noi; C:\Library\D\src\temp>dmd bug7.d -version=bad bug7.d(3): function bug7.A.TReader!() TReader_.readT!(byte) readT_g.read conflic ts with bug7.A.TReader!() TReader_.readT!(ubyte) readT_h.read at bug7.d(3)Added to DStress as http://dstress.kuehne.cn/run/o/overload_25_A.d http://dstress.kuehne.cn/run/o/overload_25_B.d http://dstress.kuehne.cn/nocompile/o/overload_25_C.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFCqowC3w+/yD4P9tIRAlckAJ97rmY3O+V0uib1/eksySK8mu6n/gCeNbP4 uOko4XtHRj3gH4DOHcS54wY= =FGgT -----END PGP SIGNATURE-----
Jun 11 2005