[fpc-pascal] Variant part in objects?

Gerhard Scholz gs at g--s.de
Mon Nov 25 21:05:03 CET 2019

Do it like this:

type obj = object
                   vars : record
                                case boolean of
                              end ;
                  end ;

----- Original Message ----- 
From: "Ryan Joseph via fpc-pascal" <fpc-pascal at lists.freepascal.org>
To: "FPC-Pascal users discussions" <fpc-pascal at lists.freepascal.org>
Cc: "Ryan Joseph" <genericptr at gmail.com>
Sent: Sunday, November 24, 2019 3:18 PM
Subject: [fpc-pascal] Variant part in objects?

> Is there a reason that objects don't support variant sections like with 
> records? Maybe they mess with the VMT table when virtual methods are 
> added?
> I just posted my "advanced objects" patch 
> (https://bugs.freepascal.org/view.php?id=36350) and all it does is add 
> "class operators" to objects but I was curious about the variant records 
> because it appears to be the only other thing from records that aren't in 
> objects.
> Regards,
> Ryan Joseph
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

More information about the fpc-pascal mailing list