Skip to content

Commit 434e792

Browse files
committed
Update two FlowSensitiveTyping.new callers missed by #53
#53 added a required closure parameter to FlowSensitiveTyping#initialize and updated every caller it knew about - but its branch is based on castwide#1258, not castwide#1259 (already merged into this integration branch separately), so it never saw case_node.rb (added by castwide#1259) or the already-existing call in orasgn_node.rb that castwide#1259 also touches. Both call sites already had region.closure in scope; added it as the 5th argument, matching every other already-updated caller (and_node.rb, if_node.rb, or_node.rb, while_node.rb). Verified: spec/parser/flow_sensitive_typing_spec.rb (65 examples), spec/parser (323 examples), and spec/source_map/clip_spec.rb all pass locally with 0 failures.
1 parent b008207 commit 434e792

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

lib/solargraph/parser/parser_gem/node_processors/case_node.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ def process
1111
FlowSensitiveTyping.new(locals,
1212
ivars,
1313
enclosing_breakable_pin,
14-
enclosing_compound_statement_pin).process_case(node)
14+
enclosing_compound_statement_pin,
15+
region.closure).process_case(node)
1516
process_children
1617
true
1718
end

lib/solargraph/parser/parser_gem/node_processors/orasgn_node.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def process
1414
here = get_node_start_position(node)
1515
presence = Range.new(here, closure_location.range.ending)
1616
FlowSensitiveTyping.new(locals, ivars, enclosing_breakable_pin,
17-
enclosing_compound_statement_pin).process_or_asgn(node, presence)
17+
enclosing_compound_statement_pin, region.closure).process_or_asgn(node, presence)
1818
end
1919

2020
new_node = node.updated(node.children[0].type, node.children[0].children + [node.children[1]])

0 commit comments

Comments
 (0)