Skip to content

Replace manual #copy with standard #dup#889

Open
amomchilov wants to merge 1 commit intomainfrom
Alex/replace-manual-copy-with-dup
Open

Replace manual #copy with standard #dup#889
amomchilov wants to merge 1 commit intomainfrom
Alex/replace-manual-copy-with-dup

Conversation

@amomchilov
Copy link
Copy Markdown
Contributor

No description provided.

@amomchilov amomchilov added the chore Chore task label Apr 1, 2026
def allowed_extensions=(_arg0); end

sig { returns(::Spoom::Sorbet::Config) }
def copy; end
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is this considered a breaking change? Is this API public?

@amomchilov amomchilov marked this pull request as ready for review April 1, 2026 20:11
@amomchilov amomchilov requested a review from a team as a code owner April 1, 2026 20:11
@amomchilov amomchilov self-assigned this Apr 1, 2026
@amomchilov
Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

new_config.no_stdlib = @no_stdlib
new_config
#: (Config source) -> void
def initialize_copy(source)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we need this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, otherwise the dup has shallow-copy semantics (arrays are shared). This makes it a deep copy (which is how #copy behaved).

@amomchilov amomchilov requested a review from Morriar April 1, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Chore task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants