← board

obj.Free rejected — built-in TObject has no Free method

Problem

eng.Free;   { pascal26:961: error: unexpected token () / Expected: := }

A parameterless method call on a declared method works (f.Bar; parses), so the gap is specific to Free: the built-in TObject (classes.pas notes "TObject is built in") exposes no Free method, so obj.Free is parsed as a field-access lvalue and the parser then demands :=.

Minimal repro:

type TFoo = class procedure Bar; end;
...
f := TFoo.Create;
f.Bar;    { ok }
f.Free;   { error: Expected := }

Direction

Acceptance

Log