summaryrefslogtreecommitdiff
path: root/src/compiler/ast-tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/ast-tree.c')
-rw-r--r--src/compiler/ast-tree.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/compiler/ast-tree.c b/src/compiler/ast-tree.c
index 890d159..111265f 100644
--- a/src/compiler/ast-tree.c
+++ b/src/compiler/ast-tree.c
@@ -1176,11 +1176,6 @@ AstTree *astTreeParseFunction(ParserNode *parserNode, AstTreeHelper *p_helper) {
.globalDeps = p_helper->globalDeps,
};
- if ((function->returnType =
- astTreeParse(node_metadata->returnType, &helper)) == NULL) {
- goto RETURN_ERROR;
- }
-
for (size_t i = 0; i < node_arguments->size; ++i) {
ParserNode *arg = node_arguments->data[i];
if (arg->token == PARSER_TOKEN_SYMBOL_COMMA) {
@@ -1212,6 +1207,11 @@ AstTree *astTreeParseFunction(ParserNode *parserNode, AstTreeHelper *p_helper) {
}
}
+ if ((function->returnType =
+ astTreeParse(node_metadata->returnType, &helper)) == NULL) {
+ goto RETURN_ERROR;
+ }
+
for (size_t i = 0; i < body->size; ++i) {
ParserNode *node = body->data[i];
switch (node->token) {