← board

for-in over a qualified set member source fails

Symptom

After importing the PAL-backed textfile unit explicitly and compiling adventure with the POSIX platform path, the demo gets past Assign and stops at the save path:

for sp in Player.Spells do
  WriteLn(f, 'spell=' + LowerStr(SpellName(sp)));
pascal26:567: error: for-in: variable is not a string or array ()

Other similar uses exist in the inventory UI:

for sp in g.Player.Spells do ...

Player.Spells is a qualified member-access expression whose type is TSpellSet = set of TSpell.

Root Cause

Set iteration itself is implemented (feature-for-in-iteration), and qualified member-access for-in sources are implemented for arrays/strings (feature-forin-member-access-source). The node-based classifier used for qualified sources still routes only string/array metadata; it does not recover set element metadata for a set-valued field expression.

Direction

Acceptance

Log

Resolved-in: 085be11 (finalizing commit)