Skip to content

fix(sema): reject two packages that declare the same name - #3748

Merged
BaseMax merged 1 commit into
mainfrom
fix/package-identity
Nov 21, 2026
Merged

BaseMax merged 1 commit into
mainfrom
fix/package-identity

Conversation

@BaseMax

@BaseMax BaseMax commented Nov 21, 2026

Copy link
Copy Markdown
Member

Packages are keyed by their declared name, so two directories that both say package util, or a local file that says package str next to std's str, merged into one package. check passed, LLVM rejected the IR, the native backend printed garbage, and exec ran a different function than run.

The name clash check now lives in the semantic analyzer (load_package), so check, run, exec, js and the native backend all stop with the same E008 that names both files. The older driver check only ran on the C path. The two-major-versions hint moves along with it.

Tests: new check/package_claim_dirs (en and fa) and errors/package_claim_std_name; package_claim.out now shows the E008 prefix. Ran the check section (prelude_name fails the same way on main), the package-related errors tests, 25 stdlib demos under exec (same results as main), and check compiler/main.salam.

@BaseMax
BaseMax requested a review from a team as a code owner November 21, 2026 08:15
@coderabbitai

coderabbitai Bot commented Nov 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 7 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7d89d4d3-f2f4-4b3b-8a46-60fd4e9a7455
Commits

Reviewing files that changed from the base of the PR and between b546bbc and d6cdb16.

Files ignored due to path filters: 4

  • tests/en/check/package_claim.out is excluded by !**/*.out
  • tests/en/check/package_claim_dirs.out is excluded by !**/*.out
  • tests/fa/check/package_claim.out is excluded by !**/*.out
  • tests/fa/check/package_claim_dirs.out is excluded by !**/*.out
Files selected for processing: 9

  • compiler/semantic/sema_packages.salam
  • tests/en/check/package_claim_dirs/main.salam
  • tests/en/check/package_claim_dirs/one/util.salam
  • tests/en/check/package_claim_dirs/two/util.salam
  • tests/en/errors/_pkg_claim_str.salam
  • tests/en/errors/package_claim_std_name.salam
  • tests/fa/check/package_claim_dirs/main.salam
  • tests/fa/check/package_claim_dirs/one/util.salam
  • tests/fa/check/package_claim_dirs/two/util.salam
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@BaseMax
BaseMax merged commit a6d4224 into main Nov 21, 2026
15 checks passed
@BaseMax
BaseMax deleted the fix/package-identity branch November 21, 2026 08:49
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