src/analyze.cpp: default to using param_node upon callconv error;

This commit is contained in:
kristopher tate 2019-02-11 18:25:56 +09:00 committed by Andrew Kelley
parent 99adda9df5
commit 74bdc1d1f8
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9

View File

@ -1634,7 +1634,7 @@ static ZigType *analyze_fn_type(CodeGen *g, AstNode *proto_node, Scope *child_sc
}
} else if (param_node->data.param_decl.var_token != nullptr) {
if (!calling_convention_allows_zig_types(fn_type_id.cc)) {
add_node_error(g, param_node->data.param_decl.type,
add_node_error(g, param_node,
buf_sprintf("parameter of type 'var' not allowed in function with calling convention '%s'",
calling_convention_name(fn_type_id.cc)));
return g->builtin_types.entry_invalid;