-
Notifications
You must be signed in to change notification settings - Fork 172
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
Initialize signature showing Object.new signature but not the specific class signature #2585
Comments
Thank you for the bug report! This is not related to the PR you mentioned, it was always like this. Essentially, we need to map the fact that when invoking Sorbet solves this with what it calls intrinsics, defining custom type checking rules for certain method calls. We would need something similar to that so that we can create mappings between what is invoked and what the user wants to see. This is the same case for something like Note: important to remember for whoever ends up tackling this issue that Ruby does allow you to override |
Thanks for the clarification! I've also noticed that if the first class has a method like class MyExample
def test
puts 'hi'
end
...
end Doing |
Not exactly. That would require some special handling for the However, we explored type flow analysis in #2421 and concluded that the effort vs benefit was not worth it at the moment (you essentially need to build an entire type checker to get that working). I say that because of this: # We can make this work properly because all we need to look into is the immediate receiver
MyExample.new.test
# This requires more sophisticated flow analysis, which we will not invest effort at this time
# Although this specific example might look simple, the mechanisms to ensure proper type flow analysis
# are not. We need to properly track scopes, create an internal type system so that we can represent
# unions if variables are set conditionally and many other fundamental pieces of a full fledged type
# checker
a = MyExample.new
a.test |
This issue is being marked as stale because there was no activity in the last 2 months |
Let's add this to the roadmap: #2950 |
Description
Reproduction steps
class.rbs
help. It doesn't matter if the signature is different or no.This may be an issue with the neovim/lsp configuration, I'm wondering if other people see this too. I have seen this with my classes, but also with gems. The classes for the gems are loaded correctly, however when I try to instantiate it, I don't see the signature. Could be related to #2553 ?
I've created a Dockerfile where you can see this happening. There are some annoying warnings, I need to update the Dockerfile.
The text was updated successfully, but these errors were encountered: