| ... | ... | @@ -17914,6 +17914,15 @@ static TypeTableEntry *ir_analyze_instruction_unwrap_err_payload(IrAnalyze *ira, |
| 17914 | 17914 | return ira->codegen->builtin_types.entry_invalid; |
| 17915 | 17915 | TypeTableEntry *ptr_type = value->value.type; |
| 17916 | 17916 | |
| 17917 | // Because we don't have Pointer Reform yet, we can't have a pointer to a 'type'. |
| 17918 | // Therefor, we have to check for type 'type' here, so we can output a correct error |
| 17919 | // without asserting the assert below. |
| 17920 | if (ptr_type->id == TypeTableEntryIdMetaType) { |
| 17921 | ir_add_error(ira, value, |
| 17922 | buf_sprintf("expected error union type, found '%s'", buf_ptr(&ptr_type->name))); |
| 17923 | return ira->codegen->builtin_types.entry_invalid; |
| 17924 | } |
| 17925 | |
| 17917 | 17926 | // This will be a pointer type because unwrap err payload IR instruction operates on a pointer to a thing. |
| 17918 | 17927 | assert(ptr_type->id == TypeTableEntryIdPointer); |
| 17919 | 17928 | |