}
static inline b32 node_is_type(AstNode* node) {
- if (node->kind == Ast_Kind_Alias) return node_is_type((AstNode *) ((AstAlias *) node)->alias);
+ node = strip_aliases(node);
return (node->kind > Ast_Kind_Type_Start) && (node->kind < Ast_Kind_Type_End);
}
SYMRES(type, &func->return_type);
if (!node_is_type((AstNode *) func->return_type)) {
+ AstType* return_type = (AstType *) strip_aliases((AstNode *) func->return_type);
+ if (return_type->kind == Ast_Kind_Symbol) return Symres_Yield_Macro;
+
onyx_report_error(func->token->pos, "Return type is not a type.");
}