Skip to content

refactor: discriminated union narrowing in closure-analyzer#111

Merged
cs01 merged 7 commits intomainfrom
feature/discriminated-union-narrowing
Mar 8, 2026
Merged

refactor: discriminated union narrowing in closure-analyzer#111
cs01 merged 7 commits intomainfrom
feature/discriminated-union-narrowing

Conversation

@cs01
Copy link
Owner

@cs01 cs01 commented Mar 7, 2026

Summary

  • Replaces repetitive if (stmt.type === "X") + manual cast pattern in closure-mutation-checker.ts with TypeScript discriminated union narrowing
  • Removes ~220 lines of boilerplate type-cast code, replaced by ~170 lines of cleaner narrowed-type code
  • No behavior change — pure refactoring for readability and type safety

Test plan

  • All CI checks pass

🤖 Generated with Claude Code

@cs01 cs01 changed the title refactor: use discriminated union narrowing in closure-analyzer if/el… refactor: discriminated union narrowing in closure-analyzer Mar 8, 2026
@cs01 cs01 merged commit 422bff8 into main Mar 8, 2026
12 checks passed
@cs01 cs01 deleted the feature/discriminated-union-narrowing branch March 8, 2026 07:12
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