Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Duplicate identifier declaration error
Thu, Nov 19 2015 8:23 AMPermanent Link

Michael Dreher


what's wrong in this class declaration?

 TftRequest2 = class
   constructor Create; override;
   constructor Create(const queryType : string; queryNo : integer=0);

I get a compiler error for the 2'nd constructor:
 - // [Error] GlobalFunctions.wbs (255,17): Duplicate identifier declaration Create

I've seen using more than one contructor in a class in WebCode::TObjectList:
  // constructor Create; override;
  // constructor Create(AOwnsObjects: Boolean);

...and a default value for the parameter in TStringBuilder::
  // constructor Create(const Value: String='');

Michael Dreher
Thu, Nov 19 2015 11:23 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.


Email timyoung@elevatesoft.com


<< what's wrong in this class declaration? >>

It's a bug in dealing with default parameters when comparing routine prototypes.  Instead of noting that the non-default parameter count is the same and then proceeding to the actual parameter type checking, the compiler punts and stops there with an error.

I'll have a fix in the next build.

Tim Young
Elevate Software