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

Fix variance validation #418

Merged
merged 2 commits into from
Oct 17, 2020
Merged

Fix variance validation #418

merged 2 commits into from
Oct 17, 2020

Conversation

soutaro
Copy link
Member

@soutaro soutaro commented Oct 16, 2020

This PR is to make Range[T] covariant.

Adding out annotation to Range class definition didn't work because #initialize contains the parameter in in (contravariant) position. However, #initialize is a constructor, and checking the variance for the method doesn't make sense.

So, skipping #initialize during variance validation would be a good option. 🎉

`#initialize` is a constructor, and it shouldn’t make the variance check failed.
@soutaro soutaro merged commit fc27fd6 into master Oct 17, 2020
@soutaro soutaro deleted the fix-variance-validation branch October 17, 2020 06:25
pocke added a commit to pocke/rbs_rails that referenced this pull request Oct 27, 2020
elishadiah pushed a commit to elishadiah/ROR-mine that referenced this pull request Sep 20, 2022
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.

1 participant