Skip to content

Fix case-when typing (and && typing...)#259

Merged
soutaro merged 3 commits intomasterfrom
case
Nov 16, 2020
Merged

Fix case-when typing (and && typing...)#259
soutaro merged 3 commits intomasterfrom
case

Conversation

@soutaro
Copy link
Owner

@soutaro soutaro commented Nov 15, 2020

No description provided.

end
end

def test_type_case_case_when_assignment
Copy link
Owner Author

Choose a reason for hiding this comment

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

Assignments in when branches without else were nil-able even if the case-when is exhaustive.

end
end

def test_type_case_case_selector
Copy link
Owner Author

Choose a reason for hiding this comment

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

Variable type narrowing didn't work well if the condition of case-when is an assignment.

end
end

def test_bool_and_or
Copy link
Owner Author

Choose a reason for hiding this comment

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

&& with logical types returned bool || nil.

@soutaro soutaro merged commit 35587f8 into master Nov 16, 2020
@soutaro soutaro deleted the case branch November 16, 2020 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant