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

ForbidTStruct handles nilable properties #180

Merged
merged 1 commit into from
Oct 13, 2023
Merged

Conversation

Morriar
Copy link
Contributor

@Morriar Morriar commented Oct 3, 2023

Closes #179.

Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
sig { returns(Integer) }
attr_accessor :baz

sig { params(baz: Integer, foo: T.nilable(Integer), bar: T.nilable(String)).void }
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not clear why we need to change the argument order here if only dealing with keyword arguments?

Copy link
Contributor

Choose a reason for hiding this comment

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

Order is kept for keyword arguments foo and bar. Only baz is moved earlier.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sig { returns(Integer) }
attr_accessor :baz

sig { params(baz: Integer, foo: T.nilable(Integer), bar: T.nilable(String)).void }
Copy link
Contributor

Choose a reason for hiding this comment

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

Order is kept for keyword arguments foo and bar. Only baz is moved earlier.

@Morriar Morriar merged commit ad7fdbc into main Oct 13, 2023
10 checks passed
@Morriar Morriar deleted the at-forbid-tstruct-nilable branch October 13, 2023 18:47
@andyw8 andyw8 changed the title ForbitTStruct handles nilable properties ForbidTStruct handles nilable properties Oct 13, 2023
@andyw8
Copy link
Contributor

andyw8 commented Oct 13, 2023

I fixed the typo in the PR title in case anyone is searching for this.

@shopify-shipit shopify-shipit bot temporarily deployed to production October 31, 2023 15:55 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Fix a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sorbet/ForbidTStruct - autocorrect does not handle optional params without default or factory
4 participants