Skip to content

fix(compiler): enforce hide and seal on destructuring - #3448

Closed
adilalperenciftci wants to merge 1 commit into
aether-lang-dev:mainfrom
adilalperenciftci:fix/hide-seal-destructure
Closed

adilalperenciftci wants to merge 1 commit into
aether-lang-dev:mainfrom
adilalperenciftci:fix/hide-seal-destructure

Conversation

@adilalperenciftci

Copy link
Copy Markdown
Contributor

Summary

I traced a lexical-containment gap to tuple slot binding. Plain reads and assignments honored hide and seal except, but name, _ = tuple() looked up outer bindings directly and could re-bind a name excluded by the current scope.

This change checks each named destructure slot before re-binding it. An outer name blocked by hide or seal except is rejected, while a visible local below the directive and a genuinely new local inside a sealed block retain their existing behavior.

Verification

  • BEFORE: hidden and sealed-out outer names were both writable through tuple destructuring.
  • AFTER: both cases are rejected; the local-binding control still compiles.
  • sh tests/integration/hide_seal_directives/test_hide_reject.sh (18 passed)
  • make check-changelog
  • make check-tests
  • make test (634 passed)

Signed-off-by: Adil Alperen Çiftci adilalperenciftci@users.noreply.github.com

Copilot AI balanced review requested due to automatic review settings October 29, 2026 08:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

Signed-off-by: Adil Alperen Çiftci <adilalperenciftci@users.noreply.github.com>
@adilalperenciftci
adilalperenciftci force-pushed the fix/hide-seal-destructure branch 2 times, most recently from 3b243ea to 6171f7c Compare October 29, 2026 17:16
@adilalperenciftci

Copy link
Copy Markdown
Contributor Author

Rebased onto current main at 356bfd8e. The test-driver conflict was additive: I retained main's four DSL-receiver containment cases and placed the three tuple-destructuring cases after them.

Ubuntu VM verification:

  • hide_seal_directives: 22 passed, 0 failed.
  • Hidden outer tuple rebinding: rejected.
  • Sealed-out outer tuple rebinding: rejected.
  • Visible local and fresh tuple bindings inside the sealed block: accepted.
  • make check-tests: passed.
  • make check-changelog: passed.
  • make test: 634 passed, 0 failed.

Updated head: 6171f7ca.

@paul-hammant

Copy link
Copy Markdown
Collaborator

Thanks @adilalperenciftci! This landed in #3474, which batched nine of your PRs and merged on 2026-10-30 (ca1dae7d). Your commit went in unchanged with your authorship, so this PR is superseded, and I'm closing it.

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.

4 participants