 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Jim McKay Guest
|
Posted: Wed Jan 21, 2004 3:54 pm Post subject: SIL and "ambiguous overload call (...)" error |
|
|
Hi:
Is anyone using SIL (Standard Interface Library)?
in unit: SilSmDataRowset, I'm getting compiler error
(subject) in implementation of overloaded: Add
methods in (pasted below) class.
(this error new one for me! Never seen it before)
On borland site, only reference I could find was (D4):
http://info.borland.com/devsupport/delphi/fixes/delphi4/compiler.html
which indicates to me that indeed snipped SIL code should bomb.
It seems that others have got it to work, however. I get same
error in D5/7.
(from above borland article)
| Quote: | Area: compilerdelphilanguageoverloadingmethod
Reference Number: 345 (Published: 11/13/9
Status: Deferred to Next Rel
Date Reported: 2/23/98
Severity: Commonly Encountered
Type: Unknown
Problem:
tighten up overloading rules, and introduce a new
compiler error with the message:
"Method < identifier > with ambiguous
parameters already exists)"
Replaceing
"Ambiguous overload call to ..."
Steps:
You should define very clearly what parameter
types are considered unique with respect to define
new signatures for overloaded methods.
These rules should be based on single, simple goal:
"There should be no possible ambiguity when
calling overloaded methods with constant
expressiosn".
With this in mind, there should be only a few groups
of parameter types that will be considered unique.
For instance all integer-types would map to the
same group, so that even declaring two methods
with integer-type parameter at the same position
would be illegal. For instance, currently this
compiles:
type
TFoo = class
public
procedure Bar(A: integer); overload;
procedure Bar(A: byte); overload;
end;
Calling Bar with a constant expression, as in :
Foo.Bar(1);
is clearly ambiguous, so these declaration should be
disallowed altogether.
Introduce a new compiler error with the message:
"Method < identifier > with ambiguous
parameters already exists)"
This message should apply to by aliasing the
following types:
All string/char types:
char, string, AnsiString, shortstring, type
TString10=string[10], array of char, PChar
All integer numeric types:
byte, shortint, smallint, integer, word, cardinal,
longint, int64...
|
and declaration of offending class:
| Quote: | TRowsetFind = class (TSilObject, IDataRowsetFind)
private
FRowset: IDataRowset;
FIndex: IDataIndexInternal;
FIdxFld: Integer;
FPacket: IPacket;
protected
procedure DoFindEnd; virtual;
protected // IDataRowsetFind
procedure Add(const Value: String); overload;
procedure Add(Value: Integer); overload;
procedure Add(Value: Longword); overload;
procedure Add(const Value: TGuid); overload;
procedure Add(const Value: Double); overload;
procedure Add(Value: Char); overload;
procedure Add(Value: Byte); overload;
procedure Add(Value: Word); overload;
procedure Add(const Value: Variant); overload;
function Find(First: Boolean): Boolean; virtual;
public
constructor Create(const Rowset: IDataRowset);
destructor Destroy; override;
end;
|
According to Borland article, seems that proc(s):
Add (Value: <Integer/LongWord/Byte> )
should fail, as they do.
However, I'm told this is working for others.
Any ideas?
Thanks.
--
Regards:
Jim McKay
Posted with: XanaNews 1.15.8.5
|
|
| Back to top |
|
 |
Jim McKay Guest
|
Posted: Wed Jan 21, 2004 8:25 pm Post subject: Re: SIL and "ambiguous overload call (...)" error |
|
|
Jim McKay wrote:
| Quote: | Hi:
Is anyone using SIL (Standard Interface Library)?
in unit: SilSmDataRowset, I'm getting compiler error
(subject) in implementation of overloaded: Add
methods in (pasted below) class.
|
if anyone interested, I have solution for d5/6.
Additionally, author has told me they have one
as well (posted on their help forum on SourceForge).
--
Regards:
Jim McKay
" I was provided with additional input that was radically different
from the truth. I assisted in furthering that version. "
Oliver North
Iran Contra Hearings
Posted with: XanaNews 1.15.8.5
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|