Skip to content

Conversation

@soutaro
Copy link
Owner

@soutaro soutaro commented Mar 11, 2025

This PR fixes type checking the following Ruby code:

if location = node.location         # Assume `node` has a union type
  # location must be nonnil here
end


if env[receiver] && receiver_type.is_a?(AST::Types::Union)
result = evaluate_union_method_call(node: node, env: env, receiver: receiver, receiver_type: receiver_type)
return result if result
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returning the result here skipped further variable type refinements.

@soutaro soutaro added this to the Steep 1.10 milestone Mar 11, 2025
@soutaro soutaro merged commit 2f77d09 into master Mar 11, 2025
19 checks passed
@soutaro soutaro deleted the fix-method-call-type-refinement branch March 11, 2025 01:47
@soutaro soutaro added the Released The PR is already included in a published release label Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Released The PR is already included in a published release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants