| ... | @@ -9578,6 +9578,13 @@ static TypeTableEntry *ir_analyze_container_init_fields(IrAnalyze *ira, IrInstru | ... | @@ -9578,6 +9578,13 @@ static TypeTableEntry *ir_analyze_container_init_fields(IrAnalyze *ira, IrInstru |
| 9578 | TypeTableEntry *container_type, size_t instr_field_count, IrInstructionContainerInitFieldsField *fields, | 9578 | TypeTableEntry *container_type, size_t instr_field_count, IrInstructionContainerInitFieldsField *fields, |
| 9579 | bool depends_on_compile_var) | 9579 | bool depends_on_compile_var) |
| 9580 | { | 9580 | { |
| | 9581 | if (container_type->id != TypeTableEntryIdStruct || is_slice(container_type)) { |
| | 9582 | ir_add_error(ira, instruction, |
| | 9583 | buf_sprintf("type '%s' does not support struct initialization syntax", |
| | 9584 | buf_ptr(&container_type->name))); |
| | 9585 | return ira->codegen->builtin_types.entry_invalid; |
| | 9586 | } |
| | 9587 | |
| 9581 | if (!type_is_complete(container_type)) | 9588 | if (!type_is_complete(container_type)) |
| 9582 | resolve_container_type(ira->codegen, container_type); | 9589 | resolve_container_type(ira->codegen, container_type); |
| 9583 | | 9590 | |