Op 2021-05-30 om 13:02 schreef Sven Barth via fpc-devel:


I think it is allowed to change the result type of the variant passed in binaryop(), but am not 100% sure, and also not sure if there are other things to keep an eye for (e.g. finalization of the existing value).

Does anybody know open source custom variant examples other than fmtbcd ?

The only one I'm aware of that makes use of BinaryOp is Python4Delphi ( https://github.com/pyscripter/python4delphi/blob/master/Source/VarPyth.pas ). mORMot derives its TSynInvokeableVariantType and thus its TDocVariant from TInvokableVariantType, but does not override the operator methods.

I think I saw this one before in March. I also remember the conclusion: this should be fixed in LefPromotion(), but FPC doesn't implement calling that method :-)
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to