Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
April 02, 2014 2.065 compiler problem | ||||
---|---|---|---|---|
| ||||
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. |
April 03, 2014 Re: 2.065 compiler problem | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ondrej Pokorny | Same under windows. Is this compiler/phobos bug? |
April 03, 2014 Re: 2.065 compiler problem | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ondrej Pokorny | 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).
|
April 04, 2014 Re: 2.065 compiler problem | ||||
---|---|---|---|---|
| ||||
Posted in reply to monarch_dodra | 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:
>> 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).
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.
|
April 06, 2014 Re: 2.065 compiler problem | ||||
---|---|---|---|---|
| ||||
Posted in reply to monarch_dodra | Ty, you made my day. |
Copyright © 1999-2021 by the D Language Foundation