diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-06-19 19:35:35 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-06-19 19:35:59 -0400 |
| commit | 7c99c30bf406342a45833963ce630bb104aef00e (patch) | |
| tree | 8fe57fa4a447cfddd4e65d32763072ed69661f18 /src | |
| parent | 42db807f375d0c8fe248eebcb4eaeed71b43075d (diff) | |
| download | zig-7c99c30bf406342a45833963ce630bb104aef00e.tar.gz zig-7c99c30bf406342a45833963ce630bb104aef00e.zip | |
fix calling method with comptime pass-by-non-copyign-value self arg
closes #1124
Diffstat (limited to 'src')
| -rw-r--r-- | src/analyze.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp index 10cdb0af6f..479abef16a 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -1470,6 +1470,17 @@ static TypeTableEntry *analyze_fn_type(CodeGen *g, AstNode *proto_node, Scope *c calling_convention_name(fn_type_id.cc))); return g->builtin_types.entry_invalid; } + if (param_node->data.param_decl.type != nullptr) { + TypeTableEntry *type_entry = analyze_type_expr(g, child_scope, param_node->data.param_decl.type); + if (type_is_invalid(type_entry)) { + return g->builtin_types.entry_invalid; + } + FnTypeParamInfo *param_info = &fn_type_id.param_info[fn_type_id.next_param_index]; + param_info->type = type_entry; + param_info->is_noalias = param_node->data.param_decl.is_noalias; + fn_type_id.next_param_index += 1; + } + return get_generic_fn_type(g, &fn_type_id); } else if (param_is_var_args) { if (fn_type_id.cc == CallingConventionC) { |
