I did not find any mention in the documentation that these keywords are supported in the context of object. […]
Good point. Currently, they’re only mentioned in the context of
class.
As long as an
object doesn’t contain virtual methods it is virtually a more sophisticated
record.
The
abstract keyword is probably, like it is documented for
class, recognized for “Delphi compatibility”, but doesn’t have any other impact. If I search for
oo_is_abstract it primarily appears in
parse_object_options. Instantiating an
abstract class will merely lead to a warning (
type_w_instance_abstract_class) produced in
pexpr.pas, but that wouldn’t really make sense for
objects, since they’re always already allocated on the stack.
As you’ve already noticed,
sealed already works for
object and emits
parser_e_sealed_descendant. This message says “Class” though, so it can be confusing.
I’ve reported a bug about the missing documentation:
issue #38535.