Skip to content

At strong typechecking level, warn on method calls off of nilable types #803

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

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

apiology
Copy link
Contributor

Require that all unique types of a complex type offer the same method before it can match when "loose unions" mode is turned off.

More specifically, require that all unique types of a complex type
offer the same method before it can match.
@apiology apiology changed the title At strong level, don't allow method calls off of nilable types At strong typechecking level, warn on method calls off of nilable types Mar 20, 2025
@apiology apiology marked this pull request as draft March 21, 2025 13:14
@apiology
Copy link
Contributor Author

apiology commented Mar 21, 2025

Realistically, there's enough return if foo.nil? code out there that this will probably have to wait until we have flow-sensitive typing. If that end up being difficult, I may propose hiding this under a --level={alpha,beta} level or somesuch. Long term we may want a flag to turn on new checks introduced between major releases, to help keep folks from being broken when we introduce things? Not sure.

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