digitalmars.D.bugs - mixins and opEquals
- Ben Hinkle (21/21) Apr 11 2005 I don't know if this has already been reported but here is a short set o...
- Regan Heath (9/32) Apr 11 2005 I think so:
- Ben Hinkle (5/14) Apr 11 2005 I think they are differnent issues. The code I posted worked fine in 119...
- Thomas Kuehne (11/38) Apr 12 2005 -----BEGIN PGP SIGNED MESSAGE-----
I don't know if this has already been reported but here is a short set of reproduction steps for the error happening to MinTL in dmd-120: template Share(T) { int opEquals(T x) { return 0; } } struct List(T) { // works // int opEquals(List x) { return 0; } // doesn't work mixin Share!(List); } int main() { List!(int) x; return 0; } gives the compiler error: C:\d\mintl>dmd bug.d bug.d(5): function bug.List!(int).List.opEquals (List *) does not match argument types (List ) bug.d(5): cannot implicitly convert expression (*(p)) of type List to List * bug.d(15): template instance bug.List!(int) error instantiating
Apr 11 2005
On Mon, 11 Apr 2005 21:28:29 -0400, Ben Hinkle <ben.hinkle gmail.com> wrote:I don't know if this has already been reportedI think so: http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D.bugs/3213 And then I thought it wasn't a bug, but a limitation: http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/20451 Now I think I miss-understood the template limitation thing, and it doesn't apply here. Reganbut here is a short set of reproduction steps for the error happening to MinTL in dmd-120: template Share(T) { int opEquals(T x) { return 0; } } struct List(T) { // works // int opEquals(List x) { return 0; } // doesn't work mixin Share!(List); } int main() { List!(int) x; return 0; } gives the compiler error: C:\d\mintl>dmd bug.d bug.d(5): function bug.List!(int).List.opEquals (List *) does not match argument types (List ) bug.d(5): cannot implicitly convert expression (*(p)) of type List to List * bug.d(15): template instance bug.List!(int) error instantiating
Apr 11 2005
"Regan Heath" <regan netwin.co.nz> wrote in message news:opso3jphje23k2f5 nrage.netwin.co.nz...On Mon, 11 Apr 2005 21:28:29 -0400, Ben Hinkle <ben.hinkle gmail.com> wrote:I think they are differnent issues. The code I posted worked fine in 119. The links talk about non-static members to classes and I'm adding it to a struct and I'm mixing it in.I don't know if this has already been reportedI think so: http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D.bugs/3213 And then I thought it wasn't a bug, but a limitation: http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/20451 Now I think I miss-understood the template limitation thing, and it doesn't apply here.
Apr 11 2005
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ben Hinkle wrote:I don't know if this has already been reported but here is a short set of reproduction steps for the error happening to MinTL in dmd-120: template Share(T) { int opEquals(T x) { return 0; } } struct List(T) { // works // int opEquals(List x) { return 0; } // doesn't work mixin Share!(List); } int main() { List!(int) x; return 0; } gives the compiler error: C:\d\mintl>dmd bug.d bug.d(5): function bug.List!(int).List.opEquals (List *) does not match argument types (List ) bug.d(5): cannot implicitly convert expression (*(p)) of type List to List * bug.d(15): template instance bug.List!(int) error instantiatingAdded to DStress as http://dstress.kuehne.cn/run/mixin_11.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFCW/Uc3w+/yD4P9tIRAhpxAJ9pSjqq8PNsUcnSCvbD0tFUqdb/PgCeMTr8 VMZyW3acnSl2F7/u7qslO2Y= =2RNv -----END PGP SIGNATURE-----
Apr 12 2005