← board

for-in: two variants produce silent wrong output (exit 0)

Progress (2026-07-15 night)

Two sub-bugs FIXED (see fix commit): non-0-based static-array bounds and N-D outer-dimension iteration (test_forin_bounds_nd). RESIDUALS:

Progress 2 (2026-07-15, agent-A)

tforin25 FIXED (commit c16db957) — three distinct silent bugs, each isolated:

  1. Record enumerator was modelled as a tyClass pointer, not an embedded record value (advancedrecords GetEnumerator returns a record by value) → MoveNext mutated a stale temp, loop ran zero times.
  2. Length of a static-array FIELD folded to 0 (the fold only handled AN_IDENT arrays) → FIndex < Length(FArr) was < 0.
  3. Whole static-array FIELD-to-FIELD copy (Result.FArr := F) truncated to one element (the whole-array IR_COPY_REC path only fired for AN_IDENT arrays). Regression: test/test_forin_record_enumerator_b355.pas.

tforin14 STILL OPEN — its residual is the aggregate-element dynamic-array gap, a feature-sized multi-layer fix now fully reconned under [[bug-pascal-openarray-of-array-param-marshal]] (see its "Recon 2"). This ticket is blocked on that feature for byte-identical parity.

Acceptance

Byte-identical stdout to FPC for both; unskip both entries. (tforin25 done; tforin14 blocked on the aggregate-element dynarray feature.)

Resolution (2026-07-15, agent-ACP — with f6a843f0)

tforin14's blocker landed: the aggregate-element dynamic-array / open-array row model ([[bug-pascal-openarray-of-array-param-marshal]], commit f6a843f0) plus the for-in open-array-param Length fix (the ArrLen=1000 placeholder was used as a static bound). Verified BOTH tests byte-identical to FPC (tforin14: '1 2 9 / 3 4 5'; tforin25: four 0 lines); conformance.tsv entries flipped to pass. Regressions: test/test_forin_record_enumerator_b355.pas (tforin25), test/test_dynarray_of_fixed_array.pas check 13 (tforin14 shape).

Log