Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2006-03

Function Redirection Problem in Interfaces

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Leandro Conde

Reproduction Procedure:

1) Define a IBase interface and put some methods int it (Base1, Base2, Base3).
2) Then define two more interfaces derived from IBas (IDerived1, IDerived2).
3) All the methods are called differently, so, is not a problem of ambiguous overloading.
4) Then make a class to implement the two derived interfaces (TTestCase).
5) Then in that class provide two sets for the IBase's methods, and implement each of the interfaces redirecting it's methods to the respective set.

For a real world example, see the code in:
http://cvs.sf.net/viewcvs.py/sil/152/

this [1, http://tinyurl.com/r2mzv]:
source/lib/SilLiDataType.pas

In that context is:
IBase == IDataTypecast, and
IDerived1 == IDataConvert,
IDerived2 = IDataAssing.

All this are implemented in[2, http://tinyurl.com/r9w9n]: source/lib/SilLiDataType.pas

And see[3, http://tinyurl.com/zrvow]:

programs/
demos/
lib/
framework/
conversion/
FmTestBaseFrameworkConversion.pas

for an example of how it is used.

Thanks, hope this helps.
Leandro.

[1]
http://cvs.sf.net/viewcvs.py/sil/152/source/lib/SilLiDataType.pas?rev=1.7&vi ew=markup

[2]
http://cvs.sf.net/viewcvs.py/sil/152/source/lib/SilLkDataHandler.pas?rev=1.9 &view=markup

[3]
http://cvs.sf.net/viewcvs.py/sil/152/programs/demos/lib/framework/conversion /FmTestBaseFrameworkConversion.pas?view=markup

Reply by email

Peter Vreman
to Leandro Conde
Show quoted text 14 lines
Reproduction Procedure: 1) Define a IBase interface and put some methods int it (Base1, Base2, Base3). 2) Then define two more interfaces derived from IBas (IDerived1, IDerived2). 3) All the methods are called differently, so, is not a problem of ambiguous overloading. 4) Then make a class to implement the two derived interfaces (TTestCase). 5) Then in that class provide two sets for the IBase's methods, and implement each of the interfaces redirecting it's methods to the respective set.

Fixed, Thanks for the test

Reply by email

Leandro Conde
to Peter Vreman

Guau!! That's speed! :)

Thanks to you, indeed!

By the way, I've managed to compile my library with FPC 2.0.2!! It needed some major changes and some extra work to bypass some units that still are relying on things not yet implemented in FPC (like the "implements" keyword).

I've run a few tests and the basics are working right now ... I'm really glad!!

Thank you again.
Leandro.

PS:
By the way, I've detected some problems with many overloaded functions that Delphi compiles ok, but FPC complains with ambiguous parameters while calling.
This week I'll be working on a new test case for sending to you about this problems.

Show quoted text 32 lines
-----Original Message----- From: On Behalf Of Peter Vreman Sent: Monday, March 27, 2006 06:34 To: FPC developers' list Subject: Re: [fpc-devel] Function Redirection Problem in Interfaces > Reproduction Procedure: > > 1) Define a IBase interface and put some methods int it (Base1, > Base2, Base3). > 2) Then define two more interfaces derived from IBas (IDerived1, > IDerived2). > 3) All the methods are called differently, so, is not a problem of > ambiguous overloading. > 4) Then make a class to implement the two derived interfaces > (TTestCase). > 5) Then in that class provide two sets for the IBase's methods, and > implement each of the interfaces redirecting it's methods to the > respective set. Fixed, Thanks for the test _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email