| ... | @@ -17037,15 +17037,6 @@ static IrInstGen *ir_analyze_tuple_cat(IrAnalyze *ira, IrInst* source_instr, | ... | @@ -17037,15 +17037,6 @@ static IrInstGen *ir_analyze_tuple_cat(IrAnalyze *ira, IrInst* source_instr, |
| 17037 | } | 17037 | } |
| 17038 | } | 17038 | } |
| 17039 | IrInstGen *result = ir_get_deref(ira, source_instr, new_struct_ptr, nullptr); | 17039 | IrInstGen *result = ir_get_deref(ira, source_instr, new_struct_ptr, nullptr); |
| 17040 | if (instr_is_comptime(result)) | | |
| 17041 | return result; | | |
| 17042 | | | |
| 17043 | if (is_comptime) { | | |
| 17044 | ir_add_error(ira, &first_non_const_instruction->base, | | |
| 17045 | buf_sprintf("unable to evaluate constant expression")); | | |
| 17046 | return ira->codegen->invalid_inst_gen; | | |
| 17047 | } | | |
| 17048 | | | |
| 17049 | return result; | 17040 | return result; |
| 17050 | } | 17041 | } |
| 17051 | | 17042 | |
| ... | @@ -18906,10 +18897,7 @@ static IrInstGen *ir_analyze_store_ptr(IrAnalyze *ira, IrInst* source_instr, | ... | @@ -18906,10 +18897,7 @@ static IrInstGen *ir_analyze_store_ptr(IrAnalyze *ira, IrInst* source_instr, |
| 18906 | } | 18897 | } |
| 18907 | | 18898 | |
| 18908 | if (ptr->value->type->data.pointer.is_const && !allow_write_through_const) { | 18899 | if (ptr->value->type->data.pointer.is_const && !allow_write_through_const) { |
| 18909 | // @TODO | 18900 | ir_add_error(ira, source_instr, buf_sprintf("cannot assign to constant")); |
| 18910 | fprintf(stderr, "store ptr\n"); | | |
| 18911 | ptr->src(); | | |
| 18912 | ir_add_error(ira, source_instr, buf_sprintf("cannot assign to constant [FOO]")); | | |
| 18913 | return ira->codegen->invalid_inst_gen; | 18901 | return ira->codegen->invalid_inst_gen; |
| 18914 | } | 18902 | } |
| 18915 | | 18903 | |
| ... | @@ -23050,7 +23038,7 @@ static IrInstGen *ir_analyze_instruction_container_init_list(IrAnalyze *ira, | ... | @@ -23050,7 +23038,7 @@ static IrInstGen *ir_analyze_instruction_container_init_list(IrAnalyze *ira, |
| 23050 | const_ptrs.deinit(); | 23038 | const_ptrs.deinit(); |
| 23051 | | 23039 | |
| 23052 | IrInstGen *result = ir_get_deref(ira, &instruction->base.base, result_loc, nullptr); | 23040 | IrInstGen *result = ir_get_deref(ira, &instruction->base.base, result_loc, nullptr); |
| 23053 | // If the result is a tuple, we are allowed to use ConstValSpecialRuntime fields. | 23041 | // If the result is a tuple, we are allowed to return a struct that uses ConstValSpecialRuntime fields at comptime. |
| 23054 | if (instr_is_comptime(result) || is_tuple(container_type)) | 23042 | if (instr_is_comptime(result) || is_tuple(container_type)) |
| 23055 | return result; | 23043 | return result; |
| 23056 | | 23044 | |