<div dir="ltr">Oops...<div class="gmail_extra"><br><div class="gmail_quote">2014-02-26 12:16 GMT-03:00 silvioprog <span dir="ltr"><<a href="mailto:silvioprog@gmail.com" target="_blank">silvioprog@gmail.com</a>></span>:</div>
<div class="gmail_quote">[...]<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"><div dir="ltr"><div class="gmail_extra">
<div>I tried that but:</div><div><br></div><div><div>"Identifier not found "TMyGenericClass"".</div></div></div></div></blockquote></div><div><br></div><div>Full test below:</div><div><br></div><div><div>
generic TMyGeneric<T> = class</div><div> public type</div><div> TMyGenericClass = class of TMyGeneric;</div><div> end;</div><div><br></div><div> TMyService = class</div><div> public</div><div> class procedure RegisterItem(aItemClass: TMyGeneric.TMyGenericClass);</div>
<div> end;</div><div><br></div><div> TMyClass = class(specialize TMyGeneric<TObject>)</div><div> end;</div></div><div><br></div><div>..</div><div><br></div><div><div>begin</div><div> TMyService.RegisterItem(TMyClass);</div>
<div>end;</div></div><div><br></div><div><div>Error: Incompatible type for arg no. 1: Got "Class Of TMyClass", expected "TMyGeneric.TMyGenericClass"</div></div><div><br></div><div>The only alternative is use "class procedure RegisterItem(aItemClass: TClass);" instead of "class procedure RegisterItem(aItemClass: *MyGenericType*);"?</div>
<div><br></div>-- <br>Silvio Clécio<br>My public projects - <a href="http://github.com/silvioprog" target="_blank">github.com/silvioprog</a>
</div></div>