<p>Am 24.03.2017 03:51 schrieb "Ryan Joseph" <<a href="mailto:ryan@thealchemistguild.com">ryan@thealchemistguild.com</a>>:<br>
> Is there anyway I could push the type checking to runtime? I wanted to using writeln also to perform some printing for debugging but I get stuck at compile time again trying to mix, integers, strings, records, classes etc… in the generic. I would use an interface but there are compiler types and records involved so that’s not an option.<br>
><br>
> type<br>
>         TLongIntMatrix = specialize TMatrix<LongInt>;<br>
>         TObjectMatrix = specialize TMatrix<TObject>;<br>
><br>
><br>
> function TMatrix.RetainValue (value: T): T;<br>
> begin<br>
>         if typeKind = tkClass then<br>
>                 TObject(value).Retain;<br>
><br>
>         result := value;<br>
> end;<br>
></p>
<p>You could try to do it with a pointer:</p>
<p>PObject(@value)^.Retain;<br></p>
<p>Regards,<br>
Sven</p>