← board

TList.Count is writable

for i := OldListCount to VarList.Count - 1 do
  TPasElement(VarList[i]).Release;
VarList.Count := OldListCount;          { pxx: property is read-only }

fcl-passrc pparser.pp:4768, in ParseVarList's error path. It is the ordinary way to unwind a list back to a mark.

Why the notify row is the whole test

A SetCount written as a bare SetLength produces the right Count, the right surviving elements and the right nil slots. Every value assertion about the container passes. What it does is drop elements without telling an owning descendant, which leaks them — and no output assertion about the list can see that. Ablated and measured: only notify fired moves, 3 -> 0.

This is the same class as the open-array leak that assert_no_leak.sh exists for; the cheap instrument here is that FPC's own Notify callback is observable, so the count of lnDeleted calls is directly comparable against the fpc oracle where a leak is not.

Log