| ... | @@ -17359,8 +17359,18 @@ static bool ir_analyze_fn_call_generic_arg(IrAnalyze *ira, AstNode *fn_proto_nod | ... | @@ -17359,8 +17359,18 @@ static bool ir_analyze_fn_call_generic_arg(IrAnalyze *ira, AstNode *fn_proto_nod |
| 17359 | } | 17359 | } |
| 17360 | } | 17360 | } |
| 17361 | | 17361 | |
| 17362 | bool comptime_arg = param_decl_node->data.param_decl.is_comptime || | 17362 | bool comptime_arg = param_decl_node->data.param_decl.is_comptime; |
| 17363 | casted_arg->value->type->id == ZigTypeIdComptimeInt || casted_arg->value->type->id == ZigTypeIdComptimeFloat; | 17363 | if (!comptime_arg) { |
| | 17364 | switch (type_requires_comptime(ira->codegen, casted_arg->value->type)) { |
| | 17365 | case ReqCompTimeInvalid: |
| | 17366 | return false; |
| | 17367 | case ReqCompTimeYes: |
| | 17368 | comptime_arg = true; |
| | 17369 | break; |
| | 17370 | case ReqCompTimeNo: |
| | 17371 | break; |
| | 17372 | } |
| | 17373 | } |
| 17364 | | 17374 | |
| 17365 | ZigValue *arg_val; | 17375 | ZigValue *arg_val; |
| 17366 | | 17376 | |
| ... | @@ -17395,17 +17405,6 @@ static bool ir_analyze_fn_call_generic_arg(IrAnalyze *ira, AstNode *fn_proto_nod | ... | @@ -17395,17 +17405,6 @@ static bool ir_analyze_fn_call_generic_arg(IrAnalyze *ira, AstNode *fn_proto_nod |
| 17395 | } | 17405 | } |
| 17396 | | 17406 | |
| 17397 | if (!comptime_arg) { | 17407 | if (!comptime_arg) { |
| 17398 | switch (type_requires_comptime(ira->codegen, casted_arg->value->type)) { | | |
| 17399 | case ReqCompTimeYes: | | |
| 17400 | ir_add_error(ira, casted_arg, | | |
| 17401 | buf_sprintf("parameter of type '%s' requires comptime", buf_ptr(&casted_arg->value->type->name))); | | |
| 17402 | return false; | | |
| 17403 | case ReqCompTimeInvalid: | | |
| 17404 | return false; | | |
| 17405 | case ReqCompTimeNo: | | |
| 17406 | break; | | |
| 17407 | } | | |
| 17408 | | | |
| 17409 | casted_args[fn_type_id->param_count] = casted_arg; | 17408 | casted_args[fn_type_id->param_count] = casted_arg; |
| 17410 | FnTypeParamInfo *param_info = &fn_type_id->param_info[fn_type_id->param_count]; | 17409 | FnTypeParamInfo *param_info = &fn_type_id->param_info[fn_type_id->param_count]; |
| 17411 | param_info->type = casted_arg->value->type; | 17410 | param_info->type = casted_arg->value->type; |