Thread overview | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
July 04, 2014 recursive definition error | ||||
---|---|---|---|---|
| ||||
After upgrading to latest dmd, I get the follow error on the code template Array(T) { alias Array = std.container.Array!T; } Error: Array!(iDataBlock).Array recursive alias declaration I don't see anything recursive about it... and the code worked before. Any ideas? |
July 04, 2014 Re: recursive definition error | ||||
---|---|---|---|---|
| ||||
Posted in reply to Frustrated | Frustrated:
> After upgrading to latest dmd, I get the follow error on the code
>
> template Array(T) { alias Array = std.container.Array!T; }
Try to use a different name inside the template, like "Vector".
Bye,
bearophile
|
July 04, 2014 Re: recursive definition error | ||||
---|---|---|---|---|
| ||||
Posted in reply to Frustrated | On Friday, 4 July 2014 at 15:07:00 UTC, Frustrated wrote:
> After upgrading to latest dmd, I get the follow error on the code
>
> template Array(T) { alias Array = std.container.Array!T; }
>
> Error: Array!(iDataBlock).Array recursive alias declaration
>
> I don't see anything recursive about it... and the code worked before. Any ideas?
Which version of DMD exactly? This works in DMD git.
|
July 04, 2014 Re: recursive definition error | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | On Friday, 4 July 2014 at 15:10:14 UTC, bearophile wrote:
> Frustrated:
>
>> After upgrading to latest dmd, I get the follow error on the code
>>
>> template Array(T) { alias Array = std.container.Array!T; }
>
> Try to use a different name inside the template, like "Vector".
>
> Bye,
> bearophile
Huh?
The template is simply wrapping std.container.Array so I can later on use change it to a different array without breaking code that uses it. As I said, it worked fine before without this recursion problem.
Since there is no recursion going on there, it shouldn't be a problem. This seems like a bug/regression.
An indirection does not help.
|
July 04, 2014 Re: recursive definition error | ||||
---|---|---|---|---|
| ||||
Posted in reply to Frustrated | Frustrated:
> Since there is no recursion going on there, it shouldn't be a problem.
Yes, sorry.
In dmd 2.066 this too could work:
alias Array(T) = std.container.Array!T;
Bye,
bearophile
|
July 04, 2014 Re: recursive definition error | ||||
---|---|---|---|---|
| ||||
Posted in reply to Marc Schütz | On Friday, 4 July 2014 at 15:37:52 UTC, Marc Schütz wrote:
> On Friday, 4 July 2014 at 15:07:00 UTC, Frustrated wrote:
>> After upgrading to latest dmd, I get the follow error on the code
>>
>> template Array(T) { alias Array = std.container.Array!T; }
>>
>> Error: Array!(iDataBlock).Array recursive alias declaration
>>
>> I don't see anything recursive about it... and the code worked before. Any ideas?
>
> Which version of DMD exactly? This works in DMD git.
I don't remember what I was using before, I think 2.064. I just upgraded to the latest 2.065.2 today and tried to compile some old code and got all these errors. The code was working fine before. Obviously I could have done something that I forgot but the errors are saying the templates are recursive as if the method doesn't work, yet it worked fine before.
|
July 04, 2014 Re: recursive definition error | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | On Friday, 4 July 2014 at 15:42:36 UTC, bearophile wrote:
> Frustrated:
>
>> Since there is no recursion going on there, it shouldn't be a problem.
>
> Yes, sorry.
>
> In dmd 2.066 this too could work:
>
> alias Array(T) = std.container.Array!T;
>
> Bye,
> bearophile
That just gives more errors.
I'm not using 2.066 though...
I will revert back to the dmd version I was using when it worked... Hopefully someone can make sure this is not a regression in the mean time... (seems like it is and I don't want to get bit again later on when I upgrade)
|
July 04, 2014 Re: recursive definition error | ||||
---|---|---|---|---|
| ||||
Posted in reply to Frustrated | On Friday, 4 July 2014 at 16:28:48 UTC, Frustrated wrote: > On Friday, 4 July 2014 at 15:42:36 UTC, bearophile wrote: >> Frustrated: > I'm not using 2.066 though... > > I will revert back to the dmd version I was using when it worked... Hopefully someone can make sure this is not a regression in the mean time... (seems like it is and I don't want to get bit again later on when I upgrade) That template and its instantiation work fine for me on both 2.065 and 2.066b1. |
July 04, 2014 Re: recursive definition error | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stanislav Blinov | On Friday, 4 July 2014 at 16:31:28 UTC, Stanislav Blinov wrote:
> On Friday, 4 July 2014 at 16:28:48 UTC, Frustrated wrote:
>> On Friday, 4 July 2014 at 15:42:36 UTC, bearophile wrote:
>>> Frustrated:
>
>> I'm not using 2.066 though...
>>
>> I will revert back to the dmd version I was using when it worked... Hopefully someone can make sure this is not a regression in the mean time... (seems like it is and I don't want to get bit again later on when I upgrade)
>
> That template and its instantiation work fine for me on both 2.065 and 2.066b1.
Ok, I do not know where this error creeped in at. I do know at one point the code was working fine without any changes I believe. (it's possible though I messed something up)
The recursive error seems to be the wrong issue. Trying to diagnose what the problem is now.
|
July 04, 2014 Re: recursive definition error | ||||
---|---|---|---|---|
| ||||
Posted in reply to Frustrated | On Friday, 4 July 2014 at 20:25:28 UTC, Frustrated wrote:
> On Friday, 4 July 2014 at 16:31:28 UTC, Stanislav Blinov wrote:
>> On Friday, 4 July 2014 at 16:28:48 UTC, Frustrated wrote:
>>> On Friday, 4 July 2014 at 15:42:36 UTC, bearophile wrote:
>>>> Frustrated:
>>
>>> I'm not using 2.066 though...
>>>
>>> I will revert back to the dmd version I was using when it worked... Hopefully someone can make sure this is not a regression in the mean time... (seems like it is and I don't want to get bit again later on when I upgrade)
>>
>> That template and its instantiation work fine for me on both 2.065 and 2.066b1.
>
> Ok, I do not know where this error creeped in at. I do know at one point the code was working fine without any changes I believe. (it's possible though I messed something up)
>
> The recursive error seems to be the wrong issue. Trying to diagnose what the problem is now.
This must be some weird issue with Array or a change in what imports does.
e.g.,
if I do
struct apple(T) { }
template Array(T) { alias apple!T Array; }
Then the code works(except I no longer can use array as an array but I do not get any recursive issues.
The compiler I was using when it worked might have been pre 2.064... Or possibly something else is going on that breaks the code.
Best I can tell is that the compiler is getting confused between std.container.Array and my Array.
|
Copyright © 1999-2021 by the D Language Foundation