<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Nov 11, 2014 at 7:08 PM, Chriss Kalogeropoulos <span dir="ltr"><<a href="mailto:iz.iznogood@gmail.com" target="_blank">iz.iznogood@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><p dir="ltr">Hi all,</p>
<p dir="ltr">I am not sure about the constructor case but I consider the FPC implementation of generics much more powerful than Delphi's assuming that Sven's comment actually works as expected. <br>
The fact that the method invocation is actually checked on specialization and not on declaration means that someone can call methods on the type parameter directly and not through some interface restriction which IMO is an ugly hack and cancels all possible optimizations for non virtual methods, since they much be called through the interface VMT.<br>
On Delphi XE5 I tried to use an interface constraint so that the compiler won't complaint about the methods and then I tried to call them through an object variable. This created a compiler internal error, even for class methods (declared in the interface but called directly from the type parameter). On FPC however it worked and IMO this is a good feature.</p></blockquote><div>Recently I have installed Free Pascal 2.7.1 and I got very suprised about the new implementations in generic structures. I'm even thinking about rewriting some of my classes to reuse those resources to the fullest.</div><div><br></div><div>I'm excited about the Free Pascal 2.8. I want to teach an advanced course of Object Pascal here in Brazil, and the Free Pascal will be the leading actor at this story. =)</div><div> <br></div></div>-- <br><div>Silvio Clécio<br>My public projects - <a href="http://github.com/silvioprog" target="_blank">github.com/silvioprog</a></div>
</div></div>