[Issue 104] Forward reference error occurs when the -g switch is invoked

Bradley Smith user at domain.invalid
Thu Sep 28 14:54:49 PDT 2006


Walter Bright wrote:
> d-bugmail at puremagic.com wrote:
>> http://d.puremagic.com/issues/show_bug.cgi?id=104
>> ------- Comment #4 from clayasaurus at gmail.com  2006-09-28 09:17 -------
>> This issue prevents being able to produce debug info if you use
>> DerelictFreeType library, which is a pretty big issue for a number of 
>> D game
>> developers. Who knows how many times I've explained this bug. I'd 
>> suggest this
>> as a 1.0 blocker. 
> 
> Why is it a blocker when it is illegal code anyway? (Foo is undefined.)

How about this code?

--- bug.d ---
Foofunc f;
typedef int Foo;
alias int function(Foo) Foofunc;
------

It compiles with dmd -c bug.d, but dmd -c -g bug.d fails with the following:

error: forward reference of Foo

Of course the workaround is to change the code to

typedef int Foo;
alias int function(Foo) Foofunc;
Foofunc f;


   Bradley



More information about the Digitalmars-d-bugs mailing list