Foreword

Problem described on this page is fixed since a long time. Now every identifier is searched roughly according to the usual Pascal identifier scope: in current class, then in current unit, then in all used units. If such search fails, then additionally a global search is performed. See LinkTag documentation.

So if the same identifier is declared in different units (or different classes, maybe within the same unit) everything works OK.

Note that there is a separate problem, not mentioned on this page, when you use overloaded routines, see ToDo page.

Problem

Duplicate names occur when two units define - for example - the same class. Lets take this example:

unit A;

interface
  TTest = class
  end;

implementation
end.

and

unit B;

interface
  TTest = class(TComponent)
  end;

implementation
end.

Now we have two different TTest classes. The documentation to them is generated properly, however the links in other files are not always generated properly.

Maybe the solution to this would be to restrict the @link tag in the following way:

@link(TClassName) only links to classes that are defined in a unit used by this unit, or in the unit itself.

@link(Unit.TClassName) can be used everywhere.

This is similar to the restriction I put on linking to methods, which are only searched for in the same class. In the first case, the used units would have to be searched just like the Delphi compiler searches them, which is from the last used unit to the first used unit. Note that this excludes units used in the implementation section of a unit, in which case one would still have to use the fully qualified classname.

DuplicateNames (last edited 2007-10-28 22:57:05 by localhost)