digitalmars.D.learn - recursive definition error
- Frustrated (5/5) Jul 04 2014 After upgrading to latest dmd, I get the follow error on the code
- bearophile (4/7) Jul 04 2014 Try to use a different name inside the template, like "Vector".
- Frustrated (9/17) Jul 04 2014 Huh?
- bearophile (6/8) Jul 04 2014 Yes, sorry.
- Frustrated (7/15) Jul 04 2014 That just gives more errors.
- Stanislav Blinov (3/10) Jul 04 2014 That template and its instantiation work fine for me on both
- Frustrated (6/17) Jul 04 2014 Ok, I do not know where this error creeped in at. I do know at
- Frustrated (14/33) Jul 04 2014 This must be some weird issue with Array or a change in what
- Frustrated (6/41) Jul 06 2014 This seems to be a regression as it works fine in 2.064. The
- Frustrated (20/20) Jul 06 2014 So, I took all the code surrounding the error message(which was a
- "Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm gmx.net> (3/24) Jul 07 2014 Have you tried dustmite? It can also reduce source code split
- Frustrated (2/32) Jul 07 2014 Thanks, I'll check it out.
- "Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm gmx.net> (2/8) Jul 04 2014 Which version of DMD exactly? This works in DMD git.
- Frustrated (7/18) Jul 04 2014 I don't remember what I was using before, I think 2.064. I just
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?
Jul 04 2014
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
Jul 04 2014
On Friday, 4 July 2014 at 15:10:14 UTC, bearophile wrote:Frustrated: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.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
Jul 04 2014
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
Jul 04 2014
On Friday, 4 July 2014 at 15:42:36 UTC, bearophile wrote:Frustrated: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)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
Jul 04 2014
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.
Jul 04 2014
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: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.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.
Jul 04 2014
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: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.On Friday, 4 July 2014 at 16:28:48 UTC, Frustrated wrote: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.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.
Jul 04 2014
On Friday, 4 July 2014 at 21:15:02 UTC, Frustrated wrote:On Friday, 4 July 2014 at 20:25:28 UTC, Frustrated wrote:This seems to be a regression as it works fine in 2.064. The error is not directly due to recursion as far as I can tell but in a template that uses the Array template. Why it breaks the array I have no idea. I will try to create a minimal project for it.On Friday, 4 July 2014 at 16:31:28 UTC, Stanislav Blinov wrote: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.On Friday, 4 July 2014 at 16:28:48 UTC, Frustrated wrote: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.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.
Jul 06 2014
So, I took all the code surrounding the error message(which was a lot of code) and stuck it into one .d file. No errors! Works as expected. So, WTF?!?! I guess now I have to attempt to split the code across modules to see WTF is going on? Maybe this is a modules issue. I know some of the code I'm using deals with module resolution and there was some talk in the main forum about changing something to do with modules. Could this be the issue? D really needs a better fing way to debug templates or improve the error messages. I'm dealing with about 20k lines of code spread across about 100 modules and the error messages are completely useless as when I put all the code surrounding what it says is causing the error, I do not get the error. Realize, this code works fine in 2.064 so it's not a coding issue as if something magical with my fingers when I copy the code from the modules into a single .d file. Either something was "fixed" or something was "broke"... after all the work I spend trying to figure out what was causing the problem, I'm just as clueless.
Jul 06 2014
On Monday, 7 July 2014 at 02:57:09 UTC, Frustrated wrote:So, I took all the code surrounding the error message(which was a lot of code) and stuck it into one .d file. No errors! Works as expected. So, WTF?!?! I guess now I have to attempt to split the code across modules to see WTF is going on? Maybe this is a modules issue. I know some of the code I'm using deals with module resolution and there was some talk in the main forum about changing something to do with modules. Could this be the issue? D really needs a better fing way to debug templates or improve the error messages. I'm dealing with about 20k lines of code spread across about 100 modules and the error messages are completely useless as when I put all the code surrounding what it says is causing the error, I do not get the error. Realize, this code works fine in 2.064 so it's not a coding issue as if something magical with my fingers when I copy the code from the modules into a single .d file. Either something was "fixed" or something was "broke"... after all the work I spend trying to figure out what was causing the problem, I'm just as clueless.Have you tried dustmite? It can also reduce source code split over several files.
Jul 07 2014
On Monday, 7 July 2014 at 09:56:17 UTC, Marc Schütz wrote:On Monday, 7 July 2014 at 02:57:09 UTC, Frustrated wrote:Thanks, I'll check it out.So, I took all the code surrounding the error message(which was a lot of code) and stuck it into one .d file. No errors! Works as expected. So, WTF?!?! I guess now I have to attempt to split the code across modules to see WTF is going on? Maybe this is a modules issue. I know some of the code I'm using deals with module resolution and there was some talk in the main forum about changing something to do with modules. Could this be the issue? D really needs a better fing way to debug templates or improve the error messages. I'm dealing with about 20k lines of code spread across about 100 modules and the error messages are completely useless as when I put all the code surrounding what it says is causing the error, I do not get the error. Realize, this code works fine in 2.064 so it's not a coding issue as if something magical with my fingers when I copy the code from the modules into a single .d file. Either something was "fixed" or something was "broke"... after all the work I spend trying to figure out what was causing the problem, I'm just as clueless.Have you tried dustmite? It can also reduce source code split over several files.
Jul 07 2014
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.
Jul 04 2014
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: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.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.
Jul 04 2014