Skip to content

Fix Alias Chain - #19

Merged
mstdokumaci merged 2 commits into
mainfrom
alias-chain
Aug 11, 2026
Merged

mstdokumaci merged 2 commits into
mainfrom
alias-chain

Conversation

@mstdokumaci

@mstdokumaci mstdokumaci commented Aug 11, 2026 •

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Bug Fixes

    • Improved import-alias resolution for multi-level and out-of-order aliases.
    • Preserved member classification for aliases.
    • Correctly rejects cyclic aliases and aliases based on local declarations.
    • Fixed deterministic ordering for aliased imports with bottom placement.
  • Tests

    • Added coverage for chained, cyclic, and order-independent aliases.
    • Added regression coverage for stable, repeatable import sorting.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 74add786-c6a2-42c9-b628-f1898b275523

📥 Commits

Reviewing files that changed from the base of the PR and between b43d11b and ffa7fb7.

📒 Files selected for processing (3)
  • src/ast_scan.zig
  • src/ast_scan_test.zig
  • src/zsort_test.zig
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/zsort_test.zig
  • src/ast_scan_test.zig
  • src/ast_scan.zig

📝 Walkthrough

Walkthrough

Alias resolution now uses fixed-point iteration to support chained aliases. It removes aliases based on local declarations and cyclic chains. Alias member status remains available. Tests cover resolution, ordering, cycles, import boundaries, and bottom-positioned sorting.

Changes

Alias resolution and sorting

Layer / File(s) Summary
Fixed-point alias resolution
src/ast_scan.zig
Alias resolution now supports multi-hop chains and declaration-order independence. Unresolved aliases based on local declarations or cycles are removed. Alias member status is preserved.
Alias chain regression coverage
src/ast_scan_test.zig, src/zsort_test.zig
Tests cover direct aliases, multi-hop chains, declaration order, cyclic aliases, import boundaries, bottom-positioned imports, and idempotent sorting.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: fixing alias-chain resolution and related behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch alias-chain

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

@mstdokumaci
mstdokumaci merged commit f55430a into main Aug 11, 2026
11 checks passed
@mstdokumaci
mstdokumaci deleted the alias-chain branch August 11, 2026 10:41
@coderabbitai coderabbitai Bot mentioned this pull request Aug 11, 2026
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