Expose a C method to parse type parameters.#44
Merged
Conversation
005a547 to
64cacae
Compare
st0012
approved these changes
May 2, 2025
Member
st0012
left a comment
There was a problem hiding this comment.
Not blocking, but do we consider exposing it at Ruby level so we can write tests for it?
I know it's not ideal, but assuming we're going to upstream this later too:
- Having test cases can help reviewing this API
- If it's going to be relied on by Sorbet, we should have tests to make sure it's not accidentally broke after upstreaming
Ideally there should be a way to test C-APIs without exposing them directly to RBS's Ruby API. Prism seems to use ffi to expose some functions separately, but it's likely to require a lot to set up.
amomchilov
approved these changes
May 2, 2025
64cacae to
a32ed74
Compare
This is useful to parse a "class signature" such as this: ```rb \#: [in A, B = String, out < Object] class Foo; end ``` Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
a32ed74 to
b5cfd1d
Compare
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
b5cfd1d to
fcc18af
Compare
Author
|
I exposed the method to Ruby and added a few tests. I hope the Ruby method won't make this too controversial 🤞 |
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.
This is useful to parse a "class signature" such as this: