Skip to content

fix: emit error for spread arguments and rest parameters instead of generating invalid ir#238

Merged
cs01 merged 2 commits intomainfrom
fix/emit-error-for-spread-rest
Mar 11, 2026
Merged

fix: emit error for spread arguments and rest parameters instead of generating invalid ir#238
cs01 merged 2 commits intomainfrom
fix/emit-error-for-spread-rest

Conversation

@cs01
Copy link
Copy Markdown
Owner

@cs01 cs01 commented Mar 11, 2026

Summary

  • sum(...args) previously generated invalid LLVM IR (passed array pointer where double expected), causing cryptic opt errors
  • function f(a, ...rest) similarly generated mismatched parameter types
  • Both now emit clear compile-time errors: "Spread arguments (...) in function calls are not yet supported" and "Rest parameters (...rest) are not yet supported"
  • Array spread literals ([...a, 4]) are unaffected and continue to work

Test plan

  • New compile-error test fixtures for spread args and rest params
  • npm run verify:quick passes (530 tests + Stage 1 self-hosting)
  • Array spread in literals still works

🤖 Generated with Claude Code

@cs01 cs01 merged commit 21ac7d7 into main Mar 11, 2026
7 checks passed
@cs01 cs01 deleted the fix/emit-error-for-spread-rest 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