Skip to content

Improve type inference system with scope-based analysis#1

Open
chipzz wants to merge 1 commit into
plusmouse:mainfrom
chipzz:type-inference-improvements
Open

Improve type inference system with scope-based analysis#1
chipzz wants to merge 1 commit into
plusmouse:mainfrom
chipzz:type-inference-improvements

Conversation

@chipzz

@chipzz chipzz commented Mar 4, 2026

Copy link
Copy Markdown
  • Fix AST cast bugs in UnaryExpression and BinaryExpression (wrong SyntaxKind)
  • Add ReturnStatement, FieldList, Field AST nodes
  • Add BinaryExpression.get_terms() and TableConstructor.field_list()
  • Rewrite variables.rs with scope chain, rich ValueType enum, and expression type inference
  • Handle all statement types (assignments, loops, if/else, function defs)
  • Infer types from operators, literals, identifiers, table constructors, and functions

This may be complete garbage, I just let Claude take a stab at it.

- Fix AST cast bugs in UnaryExpression and BinaryExpression (wrong SyntaxKind)
- Add ReturnStatement, FieldList, Field AST nodes
- Add BinaryExpression.get_terms() and TableConstructor.field_list()
- Rewrite variables.rs with scope chain, rich ValueType enum, and expression type inference
- Handle all statement types (assignments, loops, if/else, function defs)
- Infer types from operators, literals, identifiers, table constructors, and functions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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