Skip to content

Do not instantiate Public visibility for implicit public defs and attrs - #658

Open
Morriar wants to merge 2 commits into
mainfrom
at-no-default-visibility
Open

Do not instantiate Public visibility for implicit public defs and attrs#658
Morriar wants to merge 2 commits into
mainfrom
at-no-default-visibility

Conversation

@Morriar

@Morriar Morriar commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

We can use nil to represent implicit public default visibility.

cc. @michaelherold.

…ttrs

Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
@Morriar
Morriar requested a review from a team as a code owner August 28, 2026 17:44
Comment thread lib/rbi/model.rb
end

# Shared default instance to avoid allocating a new Public on every Method/Attr creation.
DEFAULT = new.freeze #: Public

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If the implicit one is now represented by nil, could we make loc required for the visibility instances?

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.

3 participants