September 14, 2014 [Issue 8328] Wrong constness of autogenerated opEquals when fields' opEquals have mixed constness | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=8328 Kenji Hara <k.hara.pg@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|WORKSFORME |DUPLICATE --- Comment #8 from Kenji Hara <k.hara.pg@gmail.com> --- (In reply to Vladimir Panteleev from comment #4) > Minimal testcase: > --- > struct S1 { bool opEquals(S1 o) { return true; } } > struct S2 { bool opEquals(S2 o) const { return true; } } > struct X { S1 s1; S2 s2; } > --- > > The problem seems to be that DMD decides that the autogenerated opEquals should be "const", and then fails when it tries to call S1's opEquals. >From 2.063, compiler never generate opEquals for structs comparison. https://github.com/D-Programming-Language/dmd/pull/1972 *** This issue has been marked as a duplicate of issue 3789 *** -- |
Copyright © 1999-2021 by the D Language Foundation