On Fri, 27 Jul 2018 11:06:11 -0600
Ryan Joseph <r...@thealchemistguild.com> wrote:

>[...]
> I’m totally confused now. Since when was it ok to call methods on nil 
> objects? 

You can't if you compile with -CR.
The RTL is not compiled with objectchecks, so it works there.

> According to this test not only can you call methods on nil objects but
> it calls the method statically (like a class method), i.e the test
> prints “DoThis”. How is that possible?

Self on x86_64 target is just a hidden argument.
It won't work with virtual methods.

Mattias

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

Reply via email to