Skip to content

Conversation

@0xGeorgii
Copy link
Contributor

Enhance the type checker and AST builder with new operator support and visibility parsing

  • Add support for division (/), unary negation (-), and bitwise NOT (~) operators in the AST builder.
  • Implement visibility parsing for functions, structs, enums, constants, and type aliases.
  • Update tests to cover new operator functionality and visibility checks.
  • Bump tree-sitter-inference version to 0.0.38.

Closes #86

…sibility parsing

- Add support for division (`/`), unary negation (`-`), and bitwise NOT (`~`) operators in the AST builder.
- Implement visibility parsing for functions, structs, enums, constants, and type aliases.
- Update tests to cover new operator functionality and visibility checks.
- Bump `tree-sitter-inference` version to 0.0.38.
@0xGeorgii 0xGeorgii self-assigned this Jan 14, 2026
@0xGeorgii 0xGeorgii requested a review from Copilot January 14, 2026 01:32
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request enhances the AST builder and type checker with support for new operators and visibility parsing functionality.

Changes:

  • Added support for division (/), unary negation (-), and bitwise NOT (~) operators
  • Implemented visibility parsing (pub) for definitions (functions, structs, enums, constants, type aliases)
  • Updated tree-sitter-inference to version 0.0.38

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/src/type_checker/features.rs Added comprehensive tests for unary negation and bitwise NOT operators on different types
tests/src/ast/builder.rs Added tests for division operator, negative literals, unary operators, and visibility parsing
core/type-checker/src/type_info.rs Added helper methods to check if a type is a signed integer
core/type-checker/src/type_checker.rs Updated to use immutable references for expressions and added type checking for new unary operators
core/ast/src/nodes.rs Added Neg and BitNot variants to UnaryOperatorKind enum
core/ast/src/builder.rs Implemented visibility parsing and support for new operators in AST building
Cargo.toml Bumped tree-sitter-inference version to 0.0.38
CHANGELOG.md Documented the new features and changes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Inferara Inferara deleted a comment from codecov bot Jan 14, 2026
This commit introduces a new test module focused on various aspects of the type checker, including statement and expression coverage, type validation, function registration, generic type inference, import resolution, symbol table operations, and visibility infrastructure. The tests cover a wide range of scenarios, including edge cases and expected failures, ensuring robust validation of the type checker implementation.
@codecov
Copy link

codecov bot commented Jan 14, 2026

Codecov Report

❌ Patch coverage is 44.89796% with 54 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
core/type-checker/src/type_checker.rs 40.00% 42 Missing ⚠️
core/type-checker/src/type_info.rs 0.00% 12 Missing ⚠️

📢 Thoughts on this report? Let us know!

@0xGeorgii 0xGeorgii requested a review from Copilot January 14, 2026 02:36
- Introduced a detailed error reference in `errors.md` covering 29 distinct error variants, including type mismatch, symbol resolution, visibility, function and method errors, operator errors, import errors, registration errors, and structural errors.
- Provided examples, solutions, and context for each error type to aid developers in understanding and resolving issues.
- Added a complete type system reference in `type-system.md`, detailing type categories, primitive types, compound types, generic types, type inference rules, operator type rules, method resolution, and visibility/access control.
- Included future features and related documentation links for further exploration.
@0xGeorgii 0xGeorgii merged commit ad5b18f into main Jan 14, 2026
4 of 5 checks passed
@0xGeorgii 0xGeorgii deleted the 86-catch-up-with-tree-sitter-inference branch January 14, 2026 03:27
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.

Catch up with latest tree-sitter-inference update

2 participants