Skip to content

Add compound assignment type inference#105

Merged
dak2 merged 1 commit into
mainfrom
feature/v020-compound-assignments
Apr 1, 2026
Merged

Add compound assignment type inference#105
dak2 merged 1 commit into
mainfrom
feature/v020-compound-assignments

Conversation

@dak2

@dak2 dak2 commented Mar 30, 2026

Copy link
Copy Markdown
Owner

Motivation

Ruby compound assignments (+=, ||=, &&=) across all 5 variable kinds (local, ivar, cvar, gvar, constant) were not tracked, causing missed type errors after in-place mutations.

Changes

  • compound_assignments.rs: process_compound_write handler with operator dispatch and Union approximation for logical assigns
  • dispatch.rs: macro-based AST node detection for 15 compound assignment nodes (5 var kinds × 3 op kinds)
  • Rust unit tests + Ruby integration tests

Checked

  • cargo test --lib
  • bundle exec rake test

🤖 Generated with Claude Code

Ruby compound assignments (+=, ||=, &&=) across all 5 variable kinds
were not tracked by the type checker, causing missed type errors
after in-place mutations like `x += 1; x.upcase`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dak2 dak2 force-pushed the feature/v020-compound-assignments branch from 9b5acb7 to dc86400 Compare March 30, 2026 14:27
@dak2 dak2 merged commit 0eb34f3 into main Apr 1, 2026
4 checks passed
@dak2 dak2 deleted the feature/v020-compound-assignments branch April 1, 2026 14:16
@dak2 dak2 added this to the v0.2.0 milestone Apr 5, 2026
@dak2 dak2 mentioned this pull request Apr 5, 2026
4 tasks
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