-
-
Notifications
You must be signed in to change notification settings - Fork 159
Flow-sensitive typing - automatically downcast from is_a? calls #856
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
Conversation
* 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
elsif n.type == :yield | ||
args = n.children.map { |c| NodeChainer.chain(c, @filename, n) } | ||
result.push Chain::Call.new('yield', args) | ||
result.push Chain::Call.new('yield', Location.from_node(n), args) | ||
elsif n.type == :const | ||
const = unpack_name(n) | ||
result.push Chain::Constant.new(const) | ||
elsif [:lvasgn, :ivasgn, :gvasgn, :cvasgn].include?(n.type) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Applied
Thanks again! |
No description provided.