Hello again
Hello again
I have this MCVE: http://pastebin.com/TsKZzyhF
Why are those interface types incompatible? With a hard-cast everything seems to go fine. Am I loosing something here?
http://pastebin.com/TsKZzyhF
I have this MCVE: http://pastebin.com/TsKZzyhF
Why are those interface types incompatible? With a hard-cast everything seems to go fine. Am I loosing something here?
http://pastebin.com/TsKZzyhF
For some odd reason I can't see this post if browsing from Delphi Developers community. I can only reach here if I navigate to my public G+ profile
ReplyDeleteIt's been flagged as spam for moderation, should be up now.
ReplyDeleteYou are expecting "covariance" where you are not having it. Take a look here: delphisorcery.blogspot.de - Generics and variance and here: http://stackoverflow.com/questions/1687755/why-are-tgenericbase-and-tgenericdescendant-incompatible-types
ReplyDeleteExactly what Christopher Wosinski said. In Delphi IGeneric is not compatible with IGeneric because for them to be compatible the T parameter would have to be declared as covariant
ReplyDeleteThank you guys
ReplyDelete