On Tue, 23 Apr 2019, Ryan Joseph wrote:



On Apr 23, 2019, at 5:32 PM, Michael Van Canneyt <mich...@freepascal.org> wrote:

That should be obvious:

Because a helper can only add methods to a type, not additional storage
space (memory). The basic type determines the memory layout of the data. A 
helper cannot change that.

Michael.

I mean for properties though so it’s not actually adding a type, just making an 
alias:

property F: integer read x;

that should just map “x” to “F”, right? I’m getting an error on this however.

I would think this should be allowed, yes. I see no reason to disallow it.

That said, I see also no reason why on earth you would want to add this, as you 
can
just access x ? The only sensible addition would be using a getter/setter,
to do some kind of check or transformation.

Michael.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to