Skip to content

Comments

Refactor type resolution#182

Draft
heshanpadmasiri wants to merge 11 commits intoballerina-platform:mainfrom
heshanpadmasiri:refact/type-resolver
Draft

Refactor type resolution#182
heshanpadmasiri wants to merge 11 commits intoballerina-platform:mainfrom
heshanpadmasiri:refact/type-resolver

Conversation

@heshanpadmasiri
Copy link
Member

Purpose

Current design for the type resolution was based on the assumption that we need the CFG to do type narrowing so we need to do type resolution before that. But conditional type narrowing sometimes invalidate these resolved types. Fortunately it turned out we can do type narrowing without type resolution of expression. Therefore this cleans up the current implementation
Resolves #173
Depends on #150

@coderabbitai
Copy link

coderabbitai bot commented Feb 22, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Feb 22, 2026

Codecov Report

❌ Patch coverage is 85.88435% with 83 lines in your changes missing coverage. Please review.
✅ Project coverage is 28.49%. Comparing base (8e7b2a8) to head (41b04e5).

Files with missing lines Patch % Lines
semantics/type_narrowing/type_narrowing.go 90.97% 21 Missing and 3 partials ⚠️
semantics/type_resolver.go 89.92% 9 Missing and 5 partials ⚠️
test_util/testphases/phases.go 74.41% 5 Missing and 6 partials ⚠️
ast/expressions.go 20.00% 8 Missing ⚠️
semantics/control_flow_analyzer.go 56.25% 6 Missing and 1 partial ⚠️
ast/statements.go 0.00% 5 Missing ⚠️
bir/non_terminator.go 0.00% 4 Missing ⚠️
ast/pretty_printer.go 78.57% 1 Missing and 2 partials ⚠️
desugar/statement.go 25.00% 3 Missing ⚠️
ast/node_builder.go 71.42% 1 Missing and 1 partial ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #182      +/-   ##
==========================================
+ Coverage   27.90%   28.49%   +0.58%     
==========================================
  Files         254      257       +3     
  Lines       53858    54306     +448     
==========================================
+ Hits        15031    15473     +442     
+ Misses      37890    37888       -2     
- Partials      937      945       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Revisit how we determine operator type errors

1 participant