| ... | ... | @@ -1585,10 +1585,6 @@ static TypeTableEntry *analyze_fn_type(CodeGen *g, AstNode *proto_node, Scope *c |
| 1585 | 1585 | case TypeTableEntryIdBlock: |
| 1586 | 1586 | case TypeTableEntryIdBoundFn: |
| 1587 | 1587 | case TypeTableEntryIdMetaType: |
| 1588 | | add_node_error(g, param_node->data.param_decl.type, |
| 1589 | | buf_sprintf("parameter of type '%s' must be declared comptime", |
| 1590 | | buf_ptr(&type_entry->name))); |
| 1591 | | return g->builtin_types.entry_invalid; |
| 1592 | 1588 | case TypeTableEntryIdVoid: |
| 1593 | 1589 | case TypeTableEntryIdBool: |
| 1594 | 1590 | case TypeTableEntryIdInt: |
| ... | ... | @@ -1603,6 +1599,13 @@ static TypeTableEntry *analyze_fn_type(CodeGen *g, AstNode *proto_node, Scope *c |
| 1603 | 1599 | case TypeTableEntryIdUnion: |
| 1604 | 1600 | case TypeTableEntryIdFn: |
| 1605 | 1601 | case TypeTableEntryIdPromise: |
| 1602 | type_ensure_zero_bits_known(g, type_entry); |
| 1603 | if (type_requires_comptime(type_entry)) { |
| 1604 | add_node_error(g, param_node->data.param_decl.type, |
| 1605 | buf_sprintf("parameter of type '%s' must be declared comptime", |
| 1606 | buf_ptr(&type_entry->name))); |
| 1607 | return g->builtin_types.entry_invalid; |
| 1608 | } |
| 1606 | 1609 | break; |
| 1607 | 1610 | } |
| 1608 | 1611 | FnTypeParamInfo *param_info = &fn_type_id.param_info[fn_type_id.next_param_index]; |
| ... | ... | @@ -5019,9 +5022,10 @@ bool type_requires_comptime(TypeTableEntry *type_entry) { |
| 5019 | 5022 | } else { |
| 5020 | 5023 | return type_requires_comptime(type_entry->data.pointer.child_type); |
| 5021 | 5024 | } |
| 5025 | case TypeTableEntryIdFn: |
| 5026 | return type_entry->data.fn.is_generic; |
| 5022 | 5027 | case TypeTableEntryIdEnum: |
| 5023 | 5028 | case TypeTableEntryIdErrorSet: |
| 5024 | | case TypeTableEntryIdFn: |
| 5025 | 5029 | case TypeTableEntryIdBool: |
| 5026 | 5030 | case TypeTableEntryIdInt: |
| 5027 | 5031 | case TypeTableEntryIdFloat: |