Flow-sensitive typing - automatically downcast from is_a? calls - #856
Merged
Conversation
apiology
marked this pull request as ready for review
April 7, 2025 02:07
apiology
marked this pull request as draft
April 10, 2025 15:12
apiology
marked this pull request as ready for review
April 10, 2025 20:41
* Populate location information from RBS files The 'rbs' gem maps the location of different definitions to the relevant point in the RGS files themselves - this change provides the ability to jump into the right place in those files to see the type definition via the LSP. * Prefer source location in language server * Resolve merge issue * Fix Path vs String type error
* Consolidate parameter handling into Pin::Closure * Clarify clobbered variable names * Fix bug in to_rbs, add spec, then fix new bug found after running spec * Catch one more Signature.new to translate from strict typechecking * Introduce Pin::Callable * Introduce Pin::Callable * Introduce Pin::Callable * Introduce Pin::Callable * Introduce Pin::Callable * Introduce Pin::Callable * Introduce Pin::Callable * Use Pin::Callable type in args_node.rb * Select String#each_line overload with mandatory vs optional arg info
castwide
reviewed
May 14, 2025
| elsif n.type == :const | ||
| const = unpack_name(n) | ||
| result.push Chain::Constant.new(const) | ||
| elsif [:lvasgn, :ivasgn, :gvasgn, :cvasgn].include?(n.type) |
Owner
There was a problem hiding this comment.
GitHub won't let me highlight the entire code block, so I can't make a proper suggestion. Replacing lines 92-102 with this resolves the conflict and passes tests:
elsif [:lvar, :lvasgn].include?(n.type)
result.push Chain::Call.new(n.children[0].to_s, Location.from_node(n))
elsif [:ivar, :ivasgn].include?(n.type)
result.push Chain::InstanceVariable.new(n.children[0].to_s)
elsif [:cvar, :cvasgn].include?(n.type)
result.push Chain::ClassVariable.new(n.children[0].to_s)
elsif [:gvar, :gvasgn].include?(n.type)
result.push Chain::GlobalVariable.new(n.children[0].to_s)
elsif n.type == :or_asgn
Owner
|
Thanks again! |
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.
No description provided.