[fpc-pascal]Yet another problem concerning Qualifiers

Michael.VanCanneyt at Wisa.be Michael.VanCanneyt at Wisa.be
Sat Jul 10 11:44:04 CEST 2004


On Fri, 9 Jul 2004, Ron Weidner wrote:

> --- Marcel Martin <mm10 at ellipsa.net> wrote:
> > Anton Tichawa a écrit :
> > > 
> > > Hello List!
> > > 
> > > Compiling the unit
> > > 
> > > ===
> > > 
> > > unit test;
> > > 
> > > interface
> > > 
> > > procedure test.do_test;
> > > 
> > > implementation
> > > 
> > > procedure test.do_test;
> > > begin
> > > end;
> > > 
> > > end.
> > > 
> > > ===
> > > 
> > > results in compiler errors:
> > > 
> > > test.pas(5,15) Error: overloaded identifier TEST
> > isn't a function
> > > test.pas(5,15) Fatal: Syntax error, ; expected but
> > . found
> 
> The following compiled for me...
> 
>  unit test;
> 
>  interface
> 
>  procedure do_test();
> 
>  implementation
> 
>  procedure do_test();
>  begin
>  end;
> 
>  begin
>  end.
> 
> I think you only need to fully qualify methods
> (functions or procedures) when they are part of an
> object.  

This is correct. One should never repeat the unit name in a declaration of
an identifier. Delphi also chokes on the original code, albeit with a
different error:

Copyright (c) 1983,2002 Borland Software Corporation
test.pp(5) Error: Identifier redeclared: 'test'
test.pp(9) Error: Identifier redeclared: 'test'
test.pp(14)
test.pp(5) Error: Unsatisfied forward or external declaration: '.1'

The last line is particularly interesting, I've never encountered that
before. A bug in the Delphi compiler? :-)

Michael.




More information about the fpc-pascal mailing list