This is getting frustrating since now I have determined that the compiler can't tell the difference an Integer and a record of the same size.
The compiler seems to understand the primitive types, but when it comes to records it picks a primitive of the same size.
for example, a TcolorRec that has R,G,B,A:Byte in it, translate to an integer so if there is an overload longint for example, the compiler picks that one instead, because it's the same size.
The strange thing is that I found this when a TColorRec overload was calling the LongInt over instead. The two are handled much differently.
So, I did a build all and after that, the compiler keeps stopping at the line I specify a TColorRec and states it is looking for an LongInt and refuses to pick the TcolorRec overload.
Apparently from what I can see, the compiler simply dispatches a primitive type matching the same size of the record.
So, I have like 6 overloads, all the same structure but different types. One of them do work and is a record but that is only because the size of the record is 8 bytes and I don't have a Uint64 in the list but If I do have it in the list, that too gets used over the correct entry containing the 8 byte record, because they are the same size.
This is bizarre to the same the least, even CODE tools can't pick the correct one.
Is there any form of TYPEINFO I can use to force the compiler to pick the RECORD type over the matching primitive types?
I was thinking of Trying to use a Generic to generate all these overloads, but I think that too may fail.
Jamie from my laptop.