May 14, 2018 [Issue 7066] You can redefine .init and .stringof without error | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=7066 Vijay Nayar <madric@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |madric@gmail.com --- Comment #9 from Vijay Nayar <madric@gmail.com> --- I encountered this problem as well while porting a C++ library to D. It took a while to diagnose, but I eventually found out that the mere existence of a function named "init" caused the RefAppender I used in a totally unrelated function to break. Example program: ``` import std.array; struct S1 { // The mere presence of this method causes the error, deleting it fixes the error. void init(string p1, int p2, int p3) { } } struct S2 { S1[] a; RefAppender!(int[]) getAppender() { return appender(&a); } } void main() { } ``` The actual error produced is obvious only because the arguments I put on init in this example, but normally it's pretty bizarre: ``` /dlang/dmd/linux/bin64/../../src/phobos/std/array.d(2907): Error: cannot have array of `void(string, int, int)` /dlang/dmd/linux/bin64/../../src/phobos/std/array.d(2976): Error: cannot have array of `inout void(string, int, int)` /dlang/dmd/linux/bin64/../../src/phobos/std/array.d(3369): Error: template instance `std.array.Appender!(S1[])` error instantiating /dlang/dmd/linux/bin64/../../src/phobos/std/array.d(3879): instantiated from here: `RefAppender!(S1[])` onlineapp.d(12): instantiated from here: `appender!(S1[]*, S1)` /dlang/dmd/linux/bin64/../../src/phobos/std/array.d(3429): Error: cannot have array of `inout void(string, int, int)` ``` -- |
May 14, 2018 [Issue 7066] You can redefine .init and .stringof without error | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=7066 Nick Treleaven <nick@geany.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |heartcollector.87@gmail.com --- Comment #10 from Nick Treleaven <nick@geany.org> --- *** Issue 14237 has been marked as a duplicate of this issue. *** -- |
May 14, 2018 [Issue 7066] You can redefine .init and .stringof without error | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=7066 Nick Treleaven <nick@geany.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@geany.org --- Comment #11 from Nick Treleaven <nick@geany.org> --- struct S { string stringof; } // Issue 14237 class MyClass { void init() {}; } `init` and `stringof` should be required to be `static`, as they are expected to work without an instance. They should probably not be allowed to be `void` functions either. -- |
May 14, 2018 [Issue 7066] You can redefine .init and .stringof without error | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=7066 Nick Treleaven <nick@geany.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |davidl@126.com --- Comment #12 from Nick Treleaven <nick@geany.org> --- *** Issue 1412 has been marked as a duplicate of this issue. *** -- |
January 08, 2020 [Issue 7066] You can redefine .init and .stringof without error | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=7066 hsteoh@quickfur.ath.cx changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hsteoh@quickfur.ath.cx -- |
January 08, 2020 [Issue 7066] You can redefine .init and .stringof without error | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=7066 Basile-z <b2.temp@gmx.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |b2.temp@gmx.com --- Comment #13 from Basile-z <b2.temp@gmx.com> --- *** Issue 17465 has been marked as a duplicate of this issue. *** -- |
March 21, 2020 [Issue 7066] You can redefine .init and .stringof without error | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=7066 Basile-z <b2.temp@gmx.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|b2.temp@gmx.com | -- |
December 17, 2022 [Issue 7066] You can redefine .init and .stringof without error | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=7066 Iain Buclaw <ibuclaw@gdcproject.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P2 |P4 -- |
Copyright © 1999-2021 by the D Language Foundation