Implementation through interface delegation not pass to descendant

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Implementation through interface delegation not pass to descendant

Free Pascal - General mailing list
I repost my question that I post on StackOverflow here in case anyone can answer it. This is my question about implementation 
of interface through delegation. Parent class is concrete class which implement an interface through delegation but descendant of this class is not considered as concrete class of the interface.

Detail of question can be read here

https://stackoverflow.com/q/55160258/5855039

Zamrony P. Juhara

Fano Framework, web application framework for modern Pascal programming language https://fanoframework.github.io



_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Implementation through interface delegation not pass to descendant

Jonas Maebe-3
On 17/03/2019 15:21, Zamrony P. Juhara via fpc-pascal wrote:
> I repost my question that I post on StackOverflow here in case anyone can answer it. This is my question about implementation
>
> of interface through delegation. Parent class is concrete class which implement an interface through delegation but descendant of this class is not considered as concrete class of the interface.
>
> Detail of question can be read here
>
> https://stackoverflow.com/q/55160258/5855039

While the question is not exactly the same, I think the answers to this
question are also applicable to yours:
https://stackoverflow.com/questions/4380002/delphi-interface-inheritance-why-cant-i-access-ancestor-interfaces-members


Jonas
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Implementation through interface delegation not pass to descendant

Martok
In reply to this post by Free Pascal - General mailing list
Am 17.03.2019 um 15:21 schrieb Zamrony P. Juhara via fpc-pascal:
> I repost my question that I post on StackOverflow here in case anyone can answer it. This is my question about implementation
>
> of interface through delegation. Parent class is concrete class which implement an interface through delegation but descendant of this class is not considered as concrete class of the interface.

I've answered on SO. Don't think it's solvable, because this would need partial
delegation on TBClass' implementation of IIntfB from knowledge of the inherited
IIntfA, which sounds a bit complex for the compiler...

As a compiler suggestion: this could be made clearer if E5042 would print the
interface type name it is missing, such as:
`Error: (5042) No matching implementation for interface method "IIntfB.writeA"
found`

--
Regards,
Martok

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Implementation through interface delegation not pass to descendant

Free Pascal - General mailing list
Hi Martok,

Thank you for explanation. 



Zamrony P. Juhara

On Mon, Mar 18, 2019 at 9:04, Martok
Am 17.03.2019 um 15:21 schrieb Zamrony P. Juhara via fpc-pascal:

> I repost my question that I post on StackOverflow here in case anyone can answer it. This is my question about implementation
>
> of interface through delegation. Parent class is concrete class which implement an interface through delegation but descendant of this class is not considered as concrete class of the interface.


I've answered on SO. Don't think it's solvable, because this would need partial
delegation on TBClass' implementation of IIntfB from knowledge of the inherited
IIntfA, which sounds a bit complex for the compiler...

As a compiler suggestion: this could be made clearer if E5042 would print the
interface type name it is missing, such as:
`Error: (5042) No matching implementation for interface method "IIntfB.writeA"
found`

--
Regards,
Martok

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal