Skip to content

fix: add missing setvariabletype in array reduce and numeric find#192

Merged
cs01 merged 1 commit intomainfrom
fix/reduce-setvariabletype
Mar 10, 2026
Merged

fix: add missing setvariabletype in array reduce and numeric find#192
cs01 merged 1 commit intomainfrom
fix/reduce-setvariabletype

Conversation

@cs01
Copy link
Copy Markdown
Owner

@cs01 cs01 commented Mar 10, 2026

Summary

  • Array reduce() (both numeric and string variants) and numeric find() were missing setVariableType calls on their return values
  • This caused downstream type tracking to lose track of what type the result is, which can lead to wrong codegen when the result is used in further operations

Changes

  • iteration.ts: Added setVariableType for generateNumericArrayReduce (double) and generateStringArrayReduce (i8*)
  • search-predicate.ts: Added setVariableType for generateNumericArrayFind (double)

Test plan

  • All 451 compiler tests pass
  • Self-hosting Stage 0 + Stage 1 pass

@cs01 cs01 merged commit 855c3b3 into main Mar 10, 2026
12 checks passed
@cs01 cs01 deleted the fix/reduce-setvariabletype branch March 12, 2026 05:35
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