diff --git a/src/analysis.cpp b/src/analysis.cpp index c214cc1..6db13d6 100644 --- a/src/analysis.cpp +++ b/src/analysis.cpp @@ -402,11 +402,8 @@ AnalysisResult analyze(Node &ast, Memory &memory) { FunctionPrototype prototype = get(function.type.data); Type return_type = get<0>(prototype.at(0)); - if (return_type.type == TypeType::Void) { - if (node.children.size() != 0) - throw TypeError(ErrorType::IncompatibleReturnValue, node.pos, {}); + if (return_type.type == TypeType::Void) return {}; - } if (node.children.size() == 0) throw TypeError(ErrorType::IncompatibleReturnValue, node.pos, {});