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
'typecheck' command fails on Ruby 2.7.1 / Solargraph 0.39.13 #350
Comments
Thanks for the info. I'm working on a fix, but I haven't been able to reproduce the error yet. I'd like to pinpoint the root cause before we patch it. It looks like the problem occurs when Solargraph tries to infer the return value of a One thing that might help is if you run |
Reproduction steps:
Output doesn't include any obvious errors (though, to be fair, I'm not entirely sure what I'm looking for 🙂) and ends with |
Thanks. I was able to reproduce the error using that repo. It happens when Solargraph tries to infer a return value from this This is the minimal reproducible example I made in a scratch project: def foo
value = case true
when value
true
else
false
end
end It looks like it only happens when the
Yeah, the scan succeeded. It didn't hit that error because it didn't try to infer the value of the local variable being assigned from the |
Awesome, thanks for your work on this project! |
Released in 0.39.14. |
0.39.14 working like a charm on Ruby 2.7.1 🥳 |
Apologies if this has been asked-and-answered. I looked through issues and found a few related to Ruby 2.7 that seem to have been addressed and a few others with similar-looking errors (#329 / #337) that seem to have been addressed as well.
Problem
Running
bundle exec solargraph typecheck
on Ruby 2.4.10 works perfectly fine. Running it on 2.7.1 does not.Versions
Expected
Actual
Code that blows up
solargraph/lib/solargraph/parser/rubyvm/node_methods.rb
Lines 200 to 202 in 35c0a92
Tiny patch that makes it not blow up
The text was updated successfully, but these errors were encountered: