Skip to content

Skip already private ! constants in excessive-visibility - #1531

Merged
yegor256 merged 1 commit into
masterfrom
1526
Oct 2, 2026
Merged

yegor256 merged 1 commit into
masterfrom
1526

Conversation

@yegor256

@yegor256 yegor256 commented Oct 2, 2026

Copy link
Copy Markdown
Member

The excessive-visibility lint decided an attribute was private by checking not(@local). That works for x >> y, but not for x >> y!. For the ! form, the parser wraps the value in .as-bytes of Φ.dataized and puts local="y" on the inner argument, two levels below the attribute the rule looks at. So the lint told people to obfuscate attributes that were already obfuscated. In eo-runtime this accounts for 71 of the 152 warnings.

The rule now skips every attribute whose generated name holds the cactus, which is the same guard unoptimizable-recursion.xsl already uses:

@name != 'φ' and not(contains(@name, '🌵')) and not(eo:test-name(@name))

The new pack allows-already-private-constant.yaml reproduces the case from the issue with x.plus 1 >> y!. It failed before the change and passes now. The existing allows-already-private-method.yaml pack still passes, so the plain >> form stays covered.

Closes #1526

A private constant written with "!" carries its local name two levels
below the attribute, so the "not(@Local)" guard missed it and the lint
asked to obfuscate an attribute that was already obfuscated. The rule
now skips every attribute whose name holds the cactus, the same guard
unoptimizable-recursion uses.
Copilot AI balanced review requested due to automatic review settings October 2, 2026 12:12

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 reached their quota limit.

@yegor256
yegor256 merged commit d22c0bc into master Oct 2, 2026
24 checks passed
@yegor256
yegor256 deleted the 1526 branch October 2, 2026 12:18
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.

excessive-visibility incorrectly recognizes a private constant as public

2 participants