digitalmars.D - 2.065 compiler problem
- Ondrej Pokorny (58/58) Apr 02 2014 Hi I have following issue:
- Ondrej Pokorny (1/1) Apr 03 2014 Same under windows. Is this compiler/phobos bug?
- monarch_dodra (5/6) Apr 03 2014 I can tell *why* it's breaking right now, but have been unable to
- monarch_dodra (11/17) Apr 04 2014 I fixed the implementation so that your test passes now. The
- Ondrej Pokorny (1/1) Apr 06 2014 Ty, you made my day.
Hi I have following issue: code: import std.stdio; import std.container; alias HierarchyGraph HGraph; class HierarchyGraph(T) { T leaf; alias leaf data; HierarchyGraph parent = null; private: Array!(HierarchyGraph) child; } int main(string[] argv) { HGraph!int a0 = new HGraph!int(); return 0; } Under 2.063 it compliles and runs. Under 2.065 following error message given: /usr/local/Cellar/dmd/2.065.0/import/std/traits.d(1948): Error: class main.HGraph!int.HierarchyGraph no size yet for forward reference /usr/local/Cellar/dmd/2.065.0/import/std/traits.d(2108): Error: template instance std.traits.FieldTypeTuple!(HGraph!int) error instantiating /usr/local/Cellar/dmd/2.065.0/import/std/traits.d(2715): instantiated from here: RepresentationTypeTuple!(HGraph!int) /usr/local/Cellar/dmd/2.065.0/import/std/container.d(2511): instantiated from here: hasIndirections!(HGraph!int) main.d(17): instantiated from here: Array!(HGraph!int) main.d(24): instantiated from here: HGraph!int /usr/local/Cellar/dmd/2.065.0/import/std/traits.d(2715): Error: template instance std.traits.RepresentationTypeTuple!(HGraph!int) error instantiating /usr/local/Cellar/dmd/2.065.0/import/std/container.d(2511): instantiated from here: hasIndirections!(HGraph!int) main.d(17): instantiated from here: Array!(HGraph!int) main.d(24): instantiated from here: HGraph!int /usr/local/Cellar/dmd/2.065.0/import/std/container.d(2511): Error: template instance std.traits.hasIndirections!(HGraph!int) error instantiating main.d(17): instantiated from here: Array!(HGraph!int) main.d(24): instantiated from here: HGraph!int /usr/local/Cellar/dmd/2.065.0/import/std/container.d(2646): Error: template instance std.typecons.RefCounted!(Payload, cast(RefCountedAutoInitialize)0) error instantiating main.d(17): instantiated from here: Array!(HGraph!int) main.d(24): instantiated from here: HGraph!int main.d(17): Error: template instance std.container.Array!(HGraph!int) error instantiating main.d(24): instantiated from here: HGraph!int main.d(24): Error: template instance main.HGraph!int error instantiating 2.065 was installed with brew unde mac os lion. 2.063 from dmg package on this site Any thoughts? Thank you.
Apr 02 2014
Same under windows. Is this compiler/phobos bug?
Apr 03 2014
On Thursday, 3 April 2014 at 07:05:13 UTC, Ondrej Pokorny wrote:Same under windows. Is this compiler/phobos bug?I can tell *why* it's breaking right now, but have been unable to understand what caused said breakage, or how it worked at all to begin with. Will reduce and file (and potentially fix).
Apr 03 2014
On Thursday, 3 April 2014 at 07:38:33 UTC, monarch_dodra wrote:On Thursday, 3 April 2014 at 07:05:13 UTC, Ondrej Pokorny wrote:I fixed the implementation so that your test passes now. The implementation was... odd. I think it may have been "legacy code" from before we had "allSatisfy" and "anySatisfy" to easilly do introspection. FYI, the issue was that "RepresentationTypeTuple" was eagerly called on input, regardless of type. Because you were operating on a forward reference, the RepresentationTypeTuple failed. My fix consisted in calling RepresentationTypeTuple *after* first checking the current type. I will submit the fix shortly.Same under windows. Is this compiler/phobos bug?I can tell *why* it's breaking right now, but have been unable to understand what caused said breakage, or how it worked at all to begin with. Will reduce and file (and potentially fix).
Apr 04 2014