> On Sep 10, 2018, at 4:23 PM, Ryan Joseph <[email protected]> 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
_______________________________________________
fpc-devel maillist - [email protected]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel