[fpc-devel] Default properties

Ryan Joseph ryan at thealchemistguild.com
Tue Sep 18 09:59:17 CEST 2018



> On Sep 10, 2018, at 4:23 PM, Ryan Joseph <ryan at thealchemistguild.com> wrote:
> 
> I think I can use tcallcandidates.create_operator to test this but what do I pass for the call param node?

I didn’t get an answer on this but I was able to figure it out for myself, albeit only for arithmetic operators, i.e.

class operator + (left: TWrapper; right: integer): TWrapper;

        ppn:=ccallparanode.create(right.getcopy,ccallparanode.create(left.getcopy,nil));
        ppn.get_paratype;
        candidates:=tcallcandidates.create_operator(optoken,ppn);
        if candidates.count > 0 then
          begin
            candidates.get_information;
            result := candidates.choose_best(tabstractprocdef(operpd),false) > 0;
          end;

For assignment operators like: class operator := (right: integer): TWrapper; the code doesn’t return any candidates. I think this is because the tcallparanode is wrong but I don’t know what to provide.

Any ideas?

Regards,
	Ryan Joseph




More information about the fpc-devel mailing list