← board

object — a rooted object-reference type

Idea

Add a built-in pointer-sized type that holds any class instance — an object reference with no specific class bound. Semantically a pointer (instance pointer, VMT at offset 0), but typed so the compiler/RTTI know it points at an object, not raw memory. Call it object (per request) — a lightweight root, like TObject without a unit.

Today there are two adjacent kinds (compiler/defs.inc): tyClass (6, pointer-sized reference to a specific user class) and tyPointer (17, untyped). The new type sits between them: a class reference with no class id — assignable from any class, requiring an explicit cast to a concrete class to touch fields/methods.

Why

Sketch

Naming caution

Legacy Object Pascal object means an old-style value type (record with methods, by-value, no implicit heap/VMT) — different from this. Confirm the keyword choice (object vs TObject vs another) before locking grammar, so we don't collide with a future value-object feature or confuse FPC-literate users.

Notes / constraints

Log