| ... | ... | @@ -1653,6 +1653,7 @@ static void analyze_top_level_declaration(CodeGen *g, ImportTableEntry *import, |
| 1653 | 1653 | node->codegen_node->data.fn_def_node.block_context = context; |
| 1654 | 1654 | |
| 1655 | 1655 | AstNodeFnProto *fn_proto = &fn_proto_node->data.fn_proto; |
| 1656 | bool is_exported = (fn_proto->visib_mod == FnProtoVisibModExport); |
| 1656 | 1657 | for (int i = 0; i < fn_proto->params.length; i += 1) { |
| 1657 | 1658 | AstNode *param_decl_node = fn_proto->params.at(i); |
| 1658 | 1659 | assert(param_decl_node->type == NodeTypeParamDecl); |
| ... | ... | @@ -1662,6 +1663,11 @@ static void analyze_top_level_declaration(CodeGen *g, ImportTableEntry *import, |
| 1662 | 1663 | assert(param_decl->type->type == NodeTypeType); |
| 1663 | 1664 | TypeTableEntry *type = param_decl->type->codegen_node->data.type_node.entry; |
| 1664 | 1665 | |
| 1666 | if (is_exported && type->id == TypeTableEntryIdStruct) { |
| 1667 | add_node_error(g, param_decl_node, |
| 1668 | buf_sprintf("byvalue struct parameters not yet supported on exported functions")); |
| 1669 | } |
| 1670 | |
| 1665 | 1671 | VariableTableEntry *variable_entry = allocate<VariableTableEntry>(1); |
| 1666 | 1672 | buf_init_from_buf(&variable_entry->name, &param_decl->name); |
| 1667 | 1673 | variable_entry->type = type; |