Open
Description
Bug Report
nodes = ["a", "b", "c"]
def foo(nodes) : {String, Int32}?
nodes.each do |node|
if node.is_a?(String) && (branches = conditional_statement_branches node) > 1
return node, branches
end
end
end
private def conditional_statement_branches(node) : Int32
2
end
pp foo nodes
Results in:
Error: method ::foo must return (Tuple(String, Int32) | Nil) but it is returning Tuple(String, Int32 | Nil)
Why does it think branches
could be nil
?