← board

A typed const array of string[N] is never initialised — silently

const Names: array[0..2] of string[8] = ('aa','bb','cc');
begin WriteLn('[', Names[0], ']'); end.

FPC prints [aa]. pxx prints eight NUL bytes and trailing garbage — no diagnostic.

Boundary (measured, fpc -O1 as oracle)

element type pxx
Integer correct
Char correct
string (AnsiString) correct
string[8] garbage
a named alias TS8 = string[8] garbage
ShortString garbage

So it is exactly the FROZEN string forms, and the managed string sibling beside them works — the usual two-spellings split.

The equivalent VAR array is fine: var a: array[0..2] of string[8] then a[0] := 'aa' reads back aa. So the storage and the ordinary assignment path are healthy; only the const INITIALISATION is wrong.

Measurements to start from (mechanism NOT yet established — do not assume)

I did not confirm which of those is the fault, and a plausible-sounding story here would be worth nothing — see devdocs/dev/debugging-playbook.md. Dump the emitted init with PXXDBG=a.ast:main / a.ir:main and compare against the working a[0] := 'aa' lowering before concluding anything.

Note for whoever takes it

Nothing in lib/, compiler/, examples/ or test/ currently uses this construct (checked), so there is no in-repo code depending on today's behaviour — a diagnostic is a safe intermediate step if the real fix is large. Silent garbage is the one outcome that must not survive, since the array-of-record sibling right beside it already refuses what it cannot do (array-of-record constant with string fields must be global).

Gate

The six element types above matching FPC, plus a named-alias element and an N-D const array of string[N]; test/test_const_array_of_string.pas still green; self-host byte-identical.

Log