Skip to content

Commit

Permalink
clean up type check
Browse files Browse the repository at this point in the history
  • Loading branch information
jackparsonss committed Jul 3, 2024
1 parent 3dfceb8 commit 896c314
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/ast/passes/type_check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,7 @@ void TypeCheck::visit_unary_operator(shared_ptr<ast::UnaryOperator> node) {

void TypeCheck::visit_conditional(shared_ptr<ast::Conditional> node) {
visit(node->condition);
if (*node->condition->get_type() != *ctx::bool_) {
throw TypeError(node->token->getLine(), "condition must be boolean");
}
check_bool(node->condition->get_type(), node->token->getLine());

visit(node->body);

Expand Down

0 comments on commit 896c314

Please sign in to comment.