Conversation
dce46d5 to
0b444e3
Compare
KaanOzkan
commented
Apr 19, 2022
KaanOzkan
commented
Apr 19, 2022
vinistock
reviewed
Apr 20, 2022
paracycle
reviewed
Apr 26, 2022
Member
paracycle
left a comment
There was a problem hiding this comment.
Thank you, this is good start. In general, it would be great to have this working both ways, depending on the version of Sorbet this code is working against, so that we can backport this to the 0.7.x series and unblock users.
paracycle
reviewed
Apr 26, 2022
73964b7 to
ebe4554
Compare
Morriar
reviewed
Apr 28, 2022
Contributor
Morriar
left a comment
There was a problem hiding this comment.
Can we add a test showing the different behavior with an old Sorbet version? 🙏
caf864b to
782948e
Compare
These tests make sure that we can read and write both the old syntax and the new syntax for type variables.
782948e to
876dcb5
Compare
vinistock
reviewed
Apr 28, 2022
vinistock
approved these changes
Apr 29, 2022
paracycle
added a commit
that referenced
this pull request
Apr 29, 2022
Support new type variable syntax
paracycle
added a commit
that referenced
this pull request
Apr 29, 2022
Support new type variable syntax
paracycle
added a commit
that referenced
this pull request
Apr 29, 2022
Support new type variable syntax
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Fixes: #901
Implementation
The implementation is best read commit by commit, but generally does the following:
type_memberandtype_templatemethod patches so that it supports bounds being supplied both as keyword arguments and as the result of calling the block.create_type_memberRBI helper method to be a more generic and finer-grainedcreate_type_variablehelper method that expects all type variable parts (that istype,variance,fixed,upperandlower) and serializes it using the serialization helper mentioned in the previous step. This allows all DSL RBIs to properly serialize their type variable annotations.Tests