Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the add_sig block nilable #371

Merged
merged 2 commits into from
Nov 14, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Make the add_sig block nilable
Sig.new defines the block to be nilable and there are plenty of cases where you can add a sig without needing/wanting to use the block syntax.
  • Loading branch information
matthewarkin authored Oct 8, 2024
commit 715c698d222754ef4e9d6d00c14b6e7633175bad
2 changes: 1 addition & 1 deletion lib/rbi/model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ def add_block_param(name)
is_final: T::Boolean,
type_params: T::Array[String],
checked: T.nilable(Symbol),
block: T.proc.params(node: Sig).void,
block: T.nilable(T.proc.params(node: Sig).void),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you mind adding a test for this under https://github.com/Shopify/rbi/blob/main/test/rbi/model_test.rb#L209 please? 🙏

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry for the delay here, test added.

).void
end
def add_sig(
Expand Down
Loading