Skip to content

Fix terminal primitive array get returns#81

Merged
luisleo526 merged 1 commit into
mainfrom
fix/terminal-array-get-return
Jul 18, 2026
Merged

Fix terminal primitive array get returns#81
luisleo526 merged 1 commit into
mainfrom
fix/terminal-array-get-return

Conversation

@luisleo526

Copy link
Copy Markdown
Contributor

Summary

  • preserve exact primitive return types when an ordinary UDF ends in a supported direct array.get(...) or receiver.get(...)
  • cache the exact return TypeSpec so downstream collection inference does not revisit stateful calls and mint extra call-site state
  • keep the change deliberately bounded to exact identifier-backed arrays and primitive elements; temporary receivers, UDT/reference-like elements, nested collections, extensions, matrix/range/view semantics, and unresolved parameters remain unchanged

Why

The analyzer already knew the array element TypeSpec, but its coarse array-method visitor returned VOID. The function analyzer discarded the exact terminal element spec, so codegen fell back to double. String returns failed C++ compilation, while integer returns often compiled and silently masked the defect. Re-inferring the terminal expression later could also duplicate stateful call sites.

Verification

  • focused and adjacent array suites: 76/76 passed with the engine include enabled
  • full Python suite: 1745 passed, 2 skipped
  • browser/Pyodide gate: 8 comparator and 10 verdict cases passed
  • full codegen gate: 277 fixtures, 263 expected-success passed, 14 expected-error passed, parity passed
  • exhaustive publication matrix: 2^5 = 32/32 expected outcomes across base/candidate, functional/member form, local/declared parameter, int/string, and direct/stateful nested consumer
  • full standard-corpus sweep: 415 classified; 408 transpile OK; public board remained Excellent 352 / Strong 47 / Moderate 4 / Weak 3; 0 upgrades and 0 downgrades
  • causal artifact audit: no generated-C++ or engine-trade semantic hash changed for any graded row

@luisleo526
luisleo526 merged commit 3da449f into main Jul 18, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant