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 NilClass#! a special method #539

Merged
merged 1 commit into from
Apr 24, 2022
Merged

Conversation

soutaro
Copy link
Owner

@soutaro soutaro commented Apr 24, 2022

This allows the following code to type check.

doc = foo()                             # doc: String?
doc = bar() unless !doc || doc.empty?   # !doc may call NilClass#! which prevents flow-sensitive typing working

This PR makes NilClass#! special method.

@soutaro soutaro merged commit 8a264b3 into master Apr 24, 2022
@soutaro soutaro deleted the fix-flow-sensitive-typing branch April 24, 2022 13:06
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.

1 participant