digitalmars.D - Forward Refrences
- Trevor Parscal (22/22) Sep 26 2005 Hey all, I have been out of the "D Loop" so to speak for the past bit, a...
- Derek Parnell (9/39) Sep 26 2005 Its the old story ... reduce it to the smallest example that exhibits th...
- Trevor Parscal (26/65) Sep 27 2005 I narrowed it down to this...
- Derek Parnell (23/100) Sep 27 2005 I'm using dmd v0.133 on Windows XP and I just tried your example and it
- Hasan Aljudy (44/83) Sep 27 2005 Is it supposed to be a bug? I thought dmd just didn't support forward
- Trevor Parscal (4/87) Sep 27 2005 Well, I guess I'm not the only one... But, how can I make it not considd...
- Chris Sauls (6/8) Sep 27 2005 In the sense of your example, it is not supported, you're right. But in...
Hey all, I have been out of the "D Loop" so to speak for the past bit, as I took some time from obsessive compulsive nonstop programming to move into a new house and get married. Now things have settled down, and I am back to work on Terra... Thanks to JRR FreeType is now working out with D and Terra can really start to progress. I updated my compiler to the latest, and now I am getting a compiler error about forward refrences... So, anyhoo, I figured I would ask you all.. Has there been anything that has changed to do with forward refrences since last time I compiled it in 0.128. The refrence is to an ENUM like this... enum RENDER { Visual, Tactile, Mask, Masked } and the error just says.. "enum RENDER is forward refrenced" and not where.. I check to see that all modules that use this enum include the module this enum is in directly... Any ideas?
Sep 26 2005
On Tue, 27 Sep 2005 05:57:29 +0000 (UTC), Trevor Parscal wrote:Hey all, I have been out of the "D Loop" so to speak for the past bit, as I took some time from obsessive compulsive nonstop programming to move into a new house and get married. Now things have settled down, and I am back to work on Terra... Thanks to JRR FreeType is now working out with D and Terra can really start to progress. I updated my compiler to the latest, and now I am getting a compiler error about forward refrences... So, anyhoo, I figured I would ask you all.. Has there been anything that has changed to do with forward refrences since last time I compiled it in 0.128. The refrence is to an ENUM like this... enum RENDER { Visual, Tactile, Mask, Masked } and the error just says.. "enum RENDER is forward refrenced" and not where.. I check to see that all modules that use this enum include the module this enum is in directly... Any ideas?Its the old story ... reduce it to the smallest example that exhibits this message and submit that. I've tried a number of things given what you have already told us and I can't get the message. -- Derek (skype: derek.j.parnell) Melbourne, Australia 27/09/2005 4:23:16 PM
Sep 26 2005
In article <89joqixrr5gf$.1el9h3pi6d9zn$.dlg 40tude.net>, Derek Parnell says...On Tue, 27 Sep 2005 05:57:29 +0000 (UTC), Trevor Parscal wrote:I narrowed it down to this... I only get the error when I use the enum as a function argument in the definition of the function... so.. file1.d /////////////// enum RENDER { Visual, Tactile } /////////////// file2.d /////////////// import file1; int test(RENDER _mode) // << this is where i get the problem { // do soemthing... } ///////////////// for now, I just cast my enums to uints and changed the functions to expect uints instead of the RENDER enum... But this is lame.. Why is this happeneing? It worked fine with 0.126 (what I think the last version I really had was) Any ideas? Thanks, Trevor ParscalHey all, I have been out of the "D Loop" so to speak for the past bit, as I took some time from obsessive compulsive nonstop programming to move into a new house and get married. Now things have settled down, and I am back to work on Terra... Thanks to JRR FreeType is now working out with D and Terra can really start to progress. I updated my compiler to the latest, and now I am getting a compiler error about forward refrences... So, anyhoo, I figured I would ask you all.. Has there been anything that has changed to do with forward refrences since last time I compiled it in 0.128. The refrence is to an ENUM like this... enum RENDER { Visual, Tactile, Mask, Masked } and the error just says.. "enum RENDER is forward refrenced" and not where.. I check to see that all modules that use this enum include the module this enum is in directly... Any ideas?Its the old story ... reduce it to the smallest example that exhibits this message and submit that. I've tried a number of things given what you have already told us and I can't get the message. -- Derek (skype: derek.j.parnell) Melbourne, Australia 27/09/2005 4:23:16 PM
Sep 27 2005
On Tue, 27 Sep 2005 14:02:49 +0000 (UTC), Trevor Parscal wrote:In article <89joqixrr5gf$.1el9h3pi6d9zn$.dlg 40tude.net>, Derek Parnell says...I'm using dmd v0.133 on Windows XP and I just tried your example and it works fine. I cannot reproduce your issue. <TEST> C:\TEMP>type test1.d enum RENDER { Visual, Tactile } C:\TEMP>type test2.d import test1; int test(RENDER _mode) // << this is where i get the problem { // do soemthing... } C:\TEMP>dmd -c test1 test2 C:\TEMP> </TEST> -- Derek Parnell Melbourne, Australia 28/09/2005 6:54:33 AMOn Tue, 27 Sep 2005 05:57:29 +0000 (UTC), Trevor Parscal wrote:I narrowed it down to this... I only get the error when I use the enum as a function argument in the definition of the function... so.. file1.d /////////////// enum RENDER { Visual, Tactile } /////////////// file2.d /////////////// import file1; int test(RENDER _mode) // << this is where i get the problem { // do soemthing... } ///////////////// for now, I just cast my enums to uints and changed the functions to expect uints instead of the RENDER enum... But this is lame.. Why is this happeneing? It worked fine with 0.126 (what I think the last version I really had was) Any ideas?Hey all, I have been out of the "D Loop" so to speak for the past bit, as I took some time from obsessive compulsive nonstop programming to move into a new house and get married. Now things have settled down, and I am back to work on Terra... Thanks to JRR FreeType is now working out with D and Terra can really start to progress. I updated my compiler to the latest, and now I am getting a compiler error about forward refrences... So, anyhoo, I figured I would ask you all.. Has there been anything that has changed to do with forward refrences since last time I compiled it in 0.128. The refrence is to an ENUM like this... enum RENDER { Visual, Tactile, Mask, Masked } and the error just says.. "enum RENDER is forward refrenced" and not where.. I check to see that all modules that use this enum include the module this enum is in directly... Any ideas?Its the old story ... reduce it to the smallest example that exhibits this message and submit that. I've tried a number of things given what you have already told us and I can't get the message. -- Derek (skype: derek.j.parnell) Melbourne, Australia 27/09/2005 4:23:16 PM
Sep 27 2005
Derek Parnell wrote:On Tue, 27 Sep 2005 05:57:29 +0000 (UTC), Trevor Parscal wrote:Is it supposed to be a bug? I thought dmd just didn't support forward referencing of enums. ------------------<erf.d>----------------------------- void main() { EXAMPLE ex = EXAMPLE.t; dosomething(ex); } void dosomething(EXAMPLE a) { writef(a); } enum EXAMPLE { a,b,c,t,y,x,w,z } ----------------------------------------------------- When trying to compile, I get the messege enum EXAMPLE is forward referenced and the file doesn't get compiled. ------------------------------------------------------- D:\Documents and Settings\Aljudy\temp>dir Volume in drive D is Windows Volume Serial Number is C0DD-D039 Directory of D:\Documents and Settings\Aljudy\temp 09/27/2005 08:57 AM <DIR> . 09/27/2005 08:57 AM <DIR> .. 09/27/2005 08:57 AM 152 erf.d 1 File(s) 152 bytes 2 Dir(s) 554,704,896 bytes free D:\Documents and Settings\Aljudy\temp>dmd erf.d enum EXAMPLE is forward referenced D:\Documents and Settings\Aljudy\temp>dir Volume in drive D is Windows Volume Serial Number is C0DD-D039 Directory of D:\Documents and Settings\Aljudy\temp 09/27/2005 08:57 AM <DIR> . 09/27/2005 08:57 AM <DIR> .. 09/27/2005 08:57 AM 152 erf.d 1 File(s) 152 bytes 2 Dir(s) 554,704,896 bytes free D:\Documents and Settings\Aljudy\temp> -------------------------------------------------------Hey all, I have been out of the "D Loop" so to speak for the past bit, as I took some time from obsessive compulsive nonstop programming to move into a new house and get married. Now things have settled down, and I am back to work on Terra... Thanks to JRR FreeType is now working out with D and Terra can really start to progress. I updated my compiler to the latest, and now I am getting a compiler error about forward refrences... So, anyhoo, I figured I would ask you all.. Has there been anything that has changed to do with forward refrences since last time I compiled it in 0.128. The refrence is to an ENUM like this... enum RENDER { Visual, Tactile, Mask, Masked } and the error just says.. "enum RENDER is forward refrenced" and not where.. I check to see that all modules that use this enum include the module this enum is in directly... Any ideas?Its the old story ... reduce it to the smallest example that exhibits this message and submit that. I've tried a number of things given what you have already told us and I can't get the message.
Sep 27 2005
In article <dhbmp3$2oq1$1 digitaldaemon.com>, Hasan Aljudy says...Derek Parnell wrote:Well, I guess I'm not the only one... But, how can I make it not considder it to be forward refrenced? - Trevor ParscalOn Tue, 27 Sep 2005 05:57:29 +0000 (UTC), Trevor Parscal wrote:Is it supposed to be a bug? I thought dmd just didn't support forward referencing of enums. ------------------<erf.d>----------------------------- void main() { EXAMPLE ex = EXAMPLE.t; dosomething(ex); } void dosomething(EXAMPLE a) { writef(a); } enum EXAMPLE { a,b,c,t,y,x,w,z } ----------------------------------------------------- When trying to compile, I get the messege enum EXAMPLE is forward referenced and the file doesn't get compiled. ------------------------------------------------------- D:\Documents and Settings\Aljudy\temp>dir Volume in drive D is Windows Volume Serial Number is C0DD-D039 Directory of D:\Documents and Settings\Aljudy\temp 09/27/2005 08:57 AM <DIR> . 09/27/2005 08:57 AM <DIR> .. 09/27/2005 08:57 AM 152 erf.d 1 File(s) 152 bytes 2 Dir(s) 554,704,896 bytes free D:\Documents and Settings\Aljudy\temp>dmd erf.d enum EXAMPLE is forward referenced D:\Documents and Settings\Aljudy\temp>dir Volume in drive D is Windows Volume Serial Number is C0DD-D039 Directory of D:\Documents and Settings\Aljudy\temp 09/27/2005 08:57 AM <DIR> . 09/27/2005 08:57 AM <DIR> .. 09/27/2005 08:57 AM 152 erf.d 1 File(s) 152 bytes 2 Dir(s) 554,704,896 bytes free D:\Documents and Settings\Aljudy\temp> -------------------------------------------------------Hey all, I have been out of the "D Loop" so to speak for the past bit, as I took some time from obsessive compulsive nonstop programming to move into a new house and get married. Now things have settled down, and I am back to work on Terra... Thanks to JRR FreeType is now working out with D and Terra can really start to progress. I updated my compiler to the latest, and now I am getting a compiler error about forward refrences... So, anyhoo, I figured I would ask you all.. Has there been anything that has changed to do with forward refrences since last time I compiled it in 0.128. The refrence is to an ENUM like this... enum RENDER { Visual, Tactile, Mask, Masked } and the error just says.. "enum RENDER is forward refrenced" and not where.. I check to see that all modules that use this enum include the module this enum is in directly... Any ideas?Its the old story ... reduce it to the smallest example that exhibits this message and submit that. I've tried a number of things given what you have already told us and I can't get the message.
Sep 27 2005
Hasan Aljudy wrote:Is it supposed to be a bug? I thought dmd just didn't support forward referencing of enums.In the sense of your example, it is not supported, you're right. But in the original poster's case, the enum is defined in a seperate module which is then imported in the module giving the error. This usage does not constitute forward referencing. For myself, I'm confused by it. -- Chris Sauls
Sep 27 2005