Skip to content

emit UnreachableBranch to the "void" condition#1356

Merged
soutaro merged 1 commit intosoutaro:masterfrom
tk0miya:emit_UnreachableBranch_to_void
Nov 29, 2024
Merged

emit UnreachableBranch to the "void" condition#1356
soutaro merged 1 commit intosoutaro:masterfrom
tk0miya:emit_UnreachableBranch_to_void

Conversation

@tk0miya
Copy link
Contributor

@tk0miya tk0miya commented Nov 25, 2024

It would be better to emit UnreachableBranch diagnostics to use "void" variables for if-conditions.

end
end

def test_unreachable_if_void
Copy link
Owner

Choose a reason for hiding this comment

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

Please move these tests to type_check_test.rb if you can.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

]
when AST::Types::Any, AST::Types::Boolean, AST::Types::Top, AST::Types::Logic::Base
[type, type]
when AST::Types::Bot, AST::Types::Void
Copy link
Owner

Choose a reason for hiding this comment

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

👍

@soutaro soutaro added this to the Steep 1.9 milestone Nov 26, 2024
It would be better to emit UnreachableBranch diagnostics to use "void"
variables for if-conditions.
@tk0miya tk0miya force-pushed the emit_UnreachableBranch_to_void branch from 51b631b to 1f0c1ef Compare November 26, 2024 11:37
Copy link
Owner

@soutaro soutaro left a comment

Choose a reason for hiding this comment

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

🙏

@soutaro soutaro merged commit 4fb0d01 into soutaro:master Nov 29, 2024
@tk0miya tk0miya deleted the emit_UnreachableBranch_to_void branch November 29, 2024 14:01
@soutaro soutaro added the Released The PR is already included in a published release label Dec 6, 2024
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