Skip to content

Commit

Permalink
Remove redundant id check on function call
Browse files Browse the repository at this point in the history
This check is redundant because it is already performed by the visit
function of `IdExprNode`.
  • Loading branch information
Lai-YT authored and leewei05 committed Jun 20, 2024
1 parent 1cf2769 commit 702d7ff
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/type_checker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -459,14 +459,6 @@ void TypeChecker::Visit(FuncCallExprNode& call_expr) {
if (call_expr.func_expr->type->IsFunc()) {
func_type = std::dynamic_pointer_cast<FuncType>(
std::shared_ptr<Type>{call_expr.func_expr->type->Clone()});
const auto* id_expr =
dynamic_cast<IdExprNode*>((call_expr.func_expr).get());
// If is an identifier, either a function or a function pointer, it should
// be declared.
if (id_expr && !env_.LookUpSymbol(id_expr->id)) {
// TODO: use of undeclared identifier 'id'
assert(false);
}
} else if (const auto* ptr_type =
dynamic_cast<PtrType*>((call_expr.func_expr->type).get());
ptr_type->base_type().IsFunc()) {
Expand Down

0 comments on commit 702d7ff

Please sign in to comment.