← board

unicodestring/widestring: types not really supported (decls "work", semantics don't)

Symptom

var w: widestring; / var u: unicodestring; parse, but the variables do not behave as strings:

Impact

The entire remaining tcase conformance cluster (20 tests: tcase0, 12–18, 24–25, 28–34, 40–41, 44) fails ONLY on the case my_str_uni of / case us of sections — the string/ansistring/widestring sections of those same tests pass. Burning this gap likely converts most of them.

Sketch

Decide the model first: FPC's unicodestring is UTF-16 + refcount, widestring likewise (COM BSTR on Windows). Cheapest useful rung: alias both to AnsiString (byte semantics, as the suite's ASCII-only tests exercise) and document the divergence; the honest rung is a real UTF-16 payload type. Aliasing must cover: assignment from literals, writeln, comparison operators, case-of-string (works free once the type maps to tyAnsiString), indexing (tcase44 does my_str_uni[3]).

Gate

make test + self-host fixedpoint. Re-run tools/run_pascal_conformance.sh --only 'tcase*' — expect the 20 unicodestring skip entries to burn.

Log