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

Lean to the optional side #1021

Merged
merged 1 commit into from
Jun 7, 2022
Merged

Lean to the optional side #1021

merged 1 commit into from
Jun 7, 2022

Conversation

ksss
Copy link
Collaborator

@ksss ksss commented Jun 6, 2022

In gem_rbs_collection, I think there are a few fixes coming so far that will make the blocks optional.

ruby/gem_rbs_collection#88
ruby/gem_rbs_collection#132
ruby/gem_rbs_collection#135
ruby/gem_rbs_collection#136
ruby/gem_rbs_collection#138
ruby/gem_rbs_collection#165

The cause is due to prototype output.

I feel it is not practical to make the block required.
I suggest leaning towards the optional side and relaxing the requirement.

Copy link
Member

@soutaro soutaro left a comment

Choose a reason for hiding this comment

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

Thanks! 👍
I agree that making blocks optional would be a better default.

Copy link
Member

@pocke pocke left a comment

Choose a reason for hiding this comment

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

LGTM!

Previously I tried to make the same change, but I didn't merge it. Because it introduces false negatives. The user cannot notice a missing block for a generated method.

But now I agree with optional blocks because the benefit is important even if there is a trade-off.

@pocke pocke merged commit 7a0727f into ruby:master Jun 7, 2022
@ksss ksss deleted the optional-block branch June 7, 2022 14:17
@ksss
Copy link
Collaborator Author

ksss commented Jun 7, 2022

@soutaro @pocke Thank you ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants