[fpc-devel] Default properties

Ryan Joseph ryan at thealchemistguild.com
Mon Sep 10 10:51:19 CEST 2018

> On Sep 7, 2018, at 6:27 PM, Sven Barth via fpc-devel <fpc-devel at lists.freepascal.org> wrote:
> tcallcandidates in htypechk.pas is your friend. That is the *only* class that deals with overload resolution and collects the eligible overloads from various sources (e.g. loaded units, current type, helper types). Essentially you only need to search for a procsym with the name of method inside the default field (all proceeds with the same name share the same procsym) and pass that on, the remainder of tcallcandidates will deal with overload resolution (you only need to make sure that the correct "Self", namely the default field is picked for that). 

Thanks, I got this working.

Just a general question. Can you clarify the difference between “tloadnode”, “tsubscriptnode” and “tcallnode”? I want to make sure I’m using them correctly.

I ask because I’m trying to parse:

wrapper + 1 { wrapper being a record with a default property }

“wrapper” is being parsed as a load node but I want to convert it to “wrapper.helper” by appending the default property. I found I can make a new subscript node using the existing load node but is that the preferred method?

p1:=csubscriptnode.create(default_property,p1); { p1 being the load node for “wrapper” }

	Ryan Joseph

More information about the fpc-devel mailing list