Skip to content
This repository was archived by the owner on Apr 29, 2026. It is now read-only.

fix: pass resolved math sugar to codegen in REPL#392

Merged
navicore merged 1 commit intonavicore:mainfrom
navicore-bot:fix/repl-math-sugar-391
Apr 5, 2026
Merged

fix: pass resolved math sugar to codegen in REPL#392
navicore merged 1 commit intonavicore:mainfrom
navicore-bot:fix/repl-math-sugar-391

Conversation

@navicore-bot
Copy link
Copy Markdown
Contributor

Summary

  • The REPL engine was missing two lines that extract and pass resolved arithmetic sugar from the typechecker to codegen
  • Without this, math sugar operators (>, <, +, -, *, /, %, =, <=, >=, <>) were never resolved to their concrete forms (i.>, f.+, etc.) during REPL compilation
  • This caused invalid LLVM IR and Clang compilation failures when using math sugar in function definitions in the REPL

Test plan

  • In the REPL, define a function using math sugar: : longer-than-five? ( String -- Bool ) string.length 5 >;
  • Verify it compiles and runs correctly
  • Test other sugar operators in REPL function definitions: +, -, *, /, <, =

Fixes #391

🤖 Generated with Claude Code

The REPL engine was missing the extraction and passing of resolved
arithmetic sugar from the typechecker to codegen. This meant math
sugar operators like `>`, `<`, `+`, etc. were never resolved to their
concrete forms (e.g., `i.>`, `f.+`) during REPL compilation, causing
invalid LLVM IR generation and Clang compilation failures.

The batch compiler in lib.rs already does this correctly. This commit
mirrors that pattern in the REPL engine.

Fixes navicore#391

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@navicore
Copy link
Copy Markdown
Owner

navicore commented Apr 5, 2026

@claude please review

@claude
Copy link
Copy Markdown

claude Bot commented Apr 5, 2026

Claude Code is working…

I'll analyze this and get back to you.

View job run

@navicore navicore merged commit 152def0 into navicore:main Apr 5, 2026
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

math shugar in repl

2 participants