| ... | @@ -887,7 +887,7 @@ static TypeTableEntry *resolve_type(CodeGen *g, AstNode *node) { | ... | @@ -887,7 +887,7 @@ static TypeTableEntry *resolve_type(CodeGen *g, AstNode *node) { |
| 887 | } else if (expr->type_entry->id == TypeTableEntryIdMetaType) { | 887 | } else if (expr->type_entry->id == TypeTableEntryIdMetaType) { |
| 888 | // OK | 888 | // OK |
| 889 | } else { | 889 | } else { |
| 890 | add_node_error(g, node, buf_sprintf("expected type, found expression")); | 890 | add_node_error(g, node, buf_sprintf("expected type 'type', found '%s'", buf_ptr(&expr->type_entry->name))); |
| 891 | return g->builtin_types.entry_invalid; | 891 | return g->builtin_types.entry_invalid; |
| 892 | } | 892 | } |
| 893 | | 893 | |
| ... | @@ -1139,7 +1139,7 @@ static FnTableEntry *resolve_const_expr_fn(CodeGen *g, ImportTableEntry *import, | ... | @@ -1139,7 +1139,7 @@ static FnTableEntry *resolve_const_expr_fn(CodeGen *g, ImportTableEntry *import, |
| 1139 | | 1139 | |
| 1140 | return const_val->data.x_fn; | 1140 | return const_val->data.x_fn; |
| 1141 | } else { | 1141 | } else { |
| 1142 | add_node_error(g, *node, buf_sprintf("expected function, got '%s'", buf_ptr(&resolved_type->name))); | 1142 | add_node_error(g, *node, buf_sprintf("expected function, found '%s'", buf_ptr(&resolved_type->name))); |
| 1143 | return nullptr; | 1143 | return nullptr; |
| 1144 | } | 1144 | } |
| 1145 | } | 1145 | } |
| ... | @@ -2292,7 +2292,7 @@ static TypeTableEntry *resolve_type_compatibility(CodeGen *g, ImportTableEntry * | ... | @@ -2292,7 +2292,7 @@ static TypeTableEntry *resolve_type_compatibility(CodeGen *g, ImportTableEntry * |
| 2292 | | 2292 | |
| 2293 | if (!reported_err) { | 2293 | if (!reported_err) { |
| 2294 | add_node_error(g, first_executing_node(node), | 2294 | add_node_error(g, first_executing_node(node), |
| 2295 | buf_sprintf("expected type '%s', got '%s'", | 2295 | buf_sprintf("expected type '%s', found '%s'", |
| 2296 | buf_ptr(&expected_type->name), | 2296 | buf_ptr(&expected_type->name), |
| 2297 | buf_ptr(&actual_type->name))); | 2297 | buf_ptr(&actual_type->name))); |
| 2298 | } | 2298 | } |
| ... | @@ -3564,14 +3564,14 @@ static TypeTableEntry *analyze_array_mult(CodeGen *g, ImportTableEntry *import, | ... | @@ -3564,14 +3564,14 @@ static TypeTableEntry *analyze_array_mult(CodeGen *g, ImportTableEntry *import, |
| 3564 | | 3564 | |
| 3565 | if (op1_type->id != TypeTableEntryIdArray) { | 3565 | if (op1_type->id != TypeTableEntryIdArray) { |
| 3566 | add_node_error(g, *op1, | 3566 | add_node_error(g, *op1, |
| 3567 | buf_sprintf("expected array type, got '%s'", buf_ptr(&op1_type->name))); | 3567 | buf_sprintf("expected array type, found '%s'", buf_ptr(&op1_type->name))); |
| 3568 | return g->builtin_types.entry_invalid; | 3568 | return g->builtin_types.entry_invalid; |
| 3569 | } | 3569 | } |
| 3570 | | 3570 | |
| 3571 | if (op2_type->id != TypeTableEntryIdNumLitInt && | 3571 | if (op2_type->id != TypeTableEntryIdNumLitInt && |
| 3572 | op2_type->id != TypeTableEntryIdInt) | 3572 | op2_type->id != TypeTableEntryIdInt) |
| 3573 | { | 3573 | { |
| 3574 | add_node_error(g, *op2, buf_sprintf("expected integer type, got '%s'", buf_ptr(&op2_type->name))); | 3574 | add_node_error(g, *op2, buf_sprintf("expected integer type, found '%s'", buf_ptr(&op2_type->name))); |
| 3575 | return g->builtin_types.entry_invalid; | 3575 | return g->builtin_types.entry_invalid; |
| 3576 | } | 3576 | } |
| 3577 | | 3577 | |
| ... | @@ -3750,7 +3750,7 @@ static TypeTableEntry *analyze_bin_op_expr(CodeGen *g, ImportTableEntry *import, | ... | @@ -3750,7 +3750,7 @@ static TypeTableEntry *analyze_bin_op_expr(CodeGen *g, ImportTableEntry *import, |
| 3750 | return child_type; | 3750 | return child_type; |
| 3751 | } else { | 3751 | } else { |
| 3752 | add_node_error(g, op1, | 3752 | add_node_error(g, op1, |
| 3753 | buf_sprintf("expected maybe type, got '%s'", | 3753 | buf_sprintf("expected maybe type, found '%s'", |
| 3754 | buf_ptr(&lhs_type->name))); | 3754 | buf_ptr(&lhs_type->name))); |
| 3755 | return g->builtin_types.entry_invalid; | 3755 | return g->builtin_types.entry_invalid; |
| 3756 | } | 3756 | } |
| ... | @@ -3770,7 +3770,7 @@ static TypeTableEntry *analyze_bin_op_expr(CodeGen *g, ImportTableEntry *import, | ... | @@ -3770,7 +3770,7 @@ static TypeTableEntry *analyze_bin_op_expr(CodeGen *g, ImportTableEntry *import, |
| 3770 | op1_type->data.pointer.child_type == g->builtin_types.entry_u8) { | 3770 | op1_type->data.pointer.child_type == g->builtin_types.entry_u8) { |
| 3771 | child_type = op1_type->data.pointer.child_type; | 3771 | child_type = op1_type->data.pointer.child_type; |
| 3772 | } else { | 3772 | } else { |
| 3773 | add_node_error(g, *op1, buf_sprintf("expected array or C string literal, got '%s'", | 3773 | add_node_error(g, *op1, buf_sprintf("expected array or C string literal, found '%s'", |
| 3774 | buf_ptr(&op1_type->name))); | 3774 | buf_ptr(&op1_type->name))); |
| 3775 | return g->builtin_types.entry_invalid; | 3775 | return g->builtin_types.entry_invalid; |
| 3776 | } | 3776 | } |
| ... | @@ -3781,7 +3781,7 @@ static TypeTableEntry *analyze_bin_op_expr(CodeGen *g, ImportTableEntry *import, | ... | @@ -3781,7 +3781,7 @@ static TypeTableEntry *analyze_bin_op_expr(CodeGen *g, ImportTableEntry *import, |
| 3781 | return g->builtin_types.entry_invalid; | 3781 | return g->builtin_types.entry_invalid; |
| 3782 | } else if (op2_type->id == TypeTableEntryIdArray) { | 3782 | } else if (op2_type->id == TypeTableEntryIdArray) { |
| 3783 | if (op2_type->data.array.child_type != child_type) { | 3783 | if (op2_type->data.array.child_type != child_type) { |
| 3784 | add_node_error(g, *op2, buf_sprintf("expected array of type '%s', got '%s'", | 3784 | add_node_error(g, *op2, buf_sprintf("expected array of type '%s', found '%s'", |
| 3785 | buf_ptr(&child_type->name), | 3785 | buf_ptr(&child_type->name), |
| 3786 | buf_ptr(&op2_type->name))); | 3786 | buf_ptr(&op2_type->name))); |
| 3787 | return g->builtin_types.entry_invalid; | 3787 | return g->builtin_types.entry_invalid; |
| ... | @@ -3789,7 +3789,7 @@ static TypeTableEntry *analyze_bin_op_expr(CodeGen *g, ImportTableEntry *import, | ... | @@ -3789,7 +3789,7 @@ static TypeTableEntry *analyze_bin_op_expr(CodeGen *g, ImportTableEntry *import, |
| 3789 | } else if (op2_type->id == TypeTableEntryIdPointer && | 3789 | } else if (op2_type->id == TypeTableEntryIdPointer && |
| 3790 | op2_type->data.pointer.child_type == g->builtin_types.entry_u8) { | 3790 | op2_type->data.pointer.child_type == g->builtin_types.entry_u8) { |
| 3791 | } else { | 3791 | } else { |
| 3792 | add_node_error(g, *op2, buf_sprintf("expected array or C string literal, got '%s'", | 3792 | add_node_error(g, *op2, buf_sprintf("expected array or C string literal, found '%s'", |
| 3793 | buf_ptr(&op2_type->name))); | 3793 | buf_ptr(&op2_type->name))); |
| 3794 | return g->builtin_types.entry_invalid; | 3794 | return g->builtin_types.entry_invalid; |
| 3795 | } | 3795 | } |
| ... | @@ -3829,12 +3829,12 @@ static TypeTableEntry *analyze_bin_op_expr(CodeGen *g, ImportTableEntry *import, | ... | @@ -3829,12 +3829,12 @@ static TypeTableEntry *analyze_bin_op_expr(CodeGen *g, ImportTableEntry *import, |
| 3829 | } else if (op1_type->id == TypeTableEntryIdPointer) { | 3829 | } else if (op1_type->id == TypeTableEntryIdPointer) { |
| 3830 | if (!op1_val->data.x_ptr.is_c_str) { | 3830 | if (!op1_val->data.x_ptr.is_c_str) { |
| 3831 | add_node_error(g, *op1, | 3831 | add_node_error(g, *op1, |
| 3832 | buf_sprintf("expected array or C string literal, got '%s'", | 3832 | buf_sprintf("expected array or C string literal, found '%s'", |
| 3833 | buf_ptr(&op1_type->name))); | 3833 | buf_ptr(&op1_type->name))); |
| 3834 | return g->builtin_types.entry_invalid; | 3834 | return g->builtin_types.entry_invalid; |
| 3835 | } else if (!op2_val->data.x_ptr.is_c_str) { | 3835 | } else if (!op2_val->data.x_ptr.is_c_str) { |
| 3836 | add_node_error(g, *op2, | 3836 | add_node_error(g, *op2, |
| 3837 | buf_sprintf("expected array or C string literal, got '%s'", | 3837 | buf_sprintf("expected array or C string literal, found '%s'", |
| 3838 | buf_ptr(&op2_type->name))); | 3838 | buf_ptr(&op2_type->name))); |
| 3839 | return g->builtin_types.entry_invalid; | 3839 | return g->builtin_types.entry_invalid; |
| 3840 | } | 3840 | } |
| ... | @@ -3951,7 +3951,7 @@ static TypeTableEntry *analyze_unwrap_error_expr(CodeGen *g, ImportTableEntry *i | ... | @@ -3951,7 +3951,7 @@ static TypeTableEntry *analyze_unwrap_error_expr(CodeGen *g, ImportTableEntry *i |
| 3951 | return child_type; | 3951 | return child_type; |
| 3952 | } else { | 3952 | } else { |
| 3953 | add_node_error(g, op1, | 3953 | add_node_error(g, op1, |
| 3954 | buf_sprintf("expected error type, got '%s'", buf_ptr(&lhs_type->name))); | 3954 | buf_sprintf("expected error type, found '%s'", buf_ptr(&lhs_type->name))); |
| 3955 | return g->builtin_types.entry_invalid; | 3955 | return g->builtin_types.entry_invalid; |
| 3956 | } | 3956 | } |
| 3957 | } | 3957 | } |
| ... | @@ -4976,7 +4976,7 @@ static TypeTableEntry *analyze_cmpxchg(CodeGen *g, ImportTableEntry *import, | ... | @@ -4976,7 +4976,7 @@ static TypeTableEntry *analyze_cmpxchg(CodeGen *g, ImportTableEntry *import, |
| 4976 | return g->builtin_types.entry_invalid; | 4976 | return g->builtin_types.entry_invalid; |
| 4977 | } else if (ptr_type->id != TypeTableEntryIdPointer) { | 4977 | } else if (ptr_type->id != TypeTableEntryIdPointer) { |
| 4978 | add_node_error(g, *ptr_arg, | 4978 | add_node_error(g, *ptr_arg, |
| 4979 | buf_sprintf("expected pointer argument, got '%s'", buf_ptr(&ptr_type->name))); | 4979 | buf_sprintf("expected pointer argument, found '%s'", buf_ptr(&ptr_type->name))); |
| 4980 | return g->builtin_types.entry_invalid; | 4980 | return g->builtin_types.entry_invalid; |
| 4981 | } | 4981 | } |
| 4982 | | 4982 | |
| ... | @@ -5082,7 +5082,7 @@ static TypeTableEntry *analyze_div_exact(CodeGen *g, ImportTableEntry *import, | ... | @@ -5082,7 +5082,7 @@ static TypeTableEntry *analyze_div_exact(CodeGen *g, ImportTableEntry *import, |
| 5082 | zig_panic("TODO"); | 5082 | zig_panic("TODO"); |
| 5083 | } else { | 5083 | } else { |
| 5084 | add_node_error(g, node, | 5084 | add_node_error(g, node, |
| 5085 | buf_sprintf("expected integer type, got '%s'", buf_ptr(&result_type->name))); | 5085 | buf_sprintf("expected integer type, found '%s'", buf_ptr(&result_type->name))); |
| 5086 | return g->builtin_types.entry_invalid; | 5086 | return g->builtin_types.entry_invalid; |
| 5087 | } | 5087 | } |
| 5088 | } | 5088 | } |
| ... | @@ -5102,16 +5102,16 @@ static TypeTableEntry *analyze_truncate(CodeGen *g, ImportTableEntry *import, | ... | @@ -5102,16 +5102,16 @@ static TypeTableEntry *analyze_truncate(CodeGen *g, ImportTableEntry *import, |
| 5102 | return g->builtin_types.entry_invalid; | 5102 | return g->builtin_types.entry_invalid; |
| 5103 | } else if (dest_type->id != TypeTableEntryIdInt) { | 5103 | } else if (dest_type->id != TypeTableEntryIdInt) { |
| 5104 | add_node_error(g, *op1, | 5104 | add_node_error(g, *op1, |
| 5105 | buf_sprintf("expected integer type, got '%s'", buf_ptr(&dest_type->name))); | 5105 | buf_sprintf("expected integer type, found '%s'", buf_ptr(&dest_type->name))); |
| 5106 | return g->builtin_types.entry_invalid; | 5106 | return g->builtin_types.entry_invalid; |
| 5107 | } else if (src_type->id != TypeTableEntryIdInt) { | 5107 | } else if (src_type->id != TypeTableEntryIdInt) { |
| 5108 | add_node_error(g, *op2, | 5108 | add_node_error(g, *op2, |
| 5109 | buf_sprintf("expected integer type, got '%s'", buf_ptr(&src_type->name))); | 5109 | buf_sprintf("expected integer type, found '%s'", buf_ptr(&src_type->name))); |
| 5110 | return g->builtin_types.entry_invalid; | 5110 | return g->builtin_types.entry_invalid; |
| 5111 | } else if (src_type->data.integral.is_signed != dest_type->data.integral.is_signed) { | 5111 | } else if (src_type->data.integral.is_signed != dest_type->data.integral.is_signed) { |
| 5112 | const char *sign_str = dest_type->data.integral.is_signed ? "signed" : "unsigned"; | 5112 | const char *sign_str = dest_type->data.integral.is_signed ? "signed" : "unsigned"; |
| 5113 | add_node_error(g, *op2, | 5113 | add_node_error(g, *op2, |
| 5114 | buf_sprintf("expected %s integer type, got '%s'", sign_str, buf_ptr(&src_type->name))); | 5114 | buf_sprintf("expected %s integer type, found '%s'", sign_str, buf_ptr(&src_type->name))); |
| 5115 | return g->builtin_types.entry_invalid; | 5115 | return g->builtin_types.entry_invalid; |
| 5116 | } else if (src_type->data.integral.bit_count <= dest_type->data.integral.bit_count) { | 5116 | } else if (src_type->data.integral.bit_count <= dest_type->data.integral.bit_count) { |
| 5117 | add_node_error(g, *op2, | 5117 | add_node_error(g, *op2, |
| ... | @@ -5348,12 +5348,12 @@ static TypeTableEntry *analyze_set_debug_safety(CodeGen *g, ImportTableEntry *im | ... | @@ -5348,12 +5348,12 @@ static TypeTableEntry *analyze_set_debug_safety(CodeGen *g, ImportTableEntry *im |
| 5348 | target_context = type_arg->data.unionation.block_context; | 5348 | target_context = type_arg->data.unionation.block_context; |
| 5349 | } else { | 5349 | } else { |
| 5350 | add_node_error(g, *target_node, | 5350 | add_node_error(g, *target_node, |
| 5351 | buf_sprintf("expected scope reference, got type '%s'", buf_ptr(&type_arg->name))); | 5351 | buf_sprintf("expected scope reference, found type '%s'", buf_ptr(&type_arg->name))); |
| 5352 | return g->builtin_types.entry_invalid; | 5352 | return g->builtin_types.entry_invalid; |
| 5353 | } | 5353 | } |
| 5354 | } else { | 5354 | } else { |
| 5355 | add_node_error(g, *target_node, | 5355 | add_node_error(g, *target_node, |
| 5356 | buf_sprintf("expected scope reference, got type '%s'", buf_ptr(&target_type->name))); | 5356 | buf_sprintf("expected scope reference, found type '%s'", buf_ptr(&target_type->name))); |
| 5357 | return g->builtin_types.entry_invalid; | 5357 | return g->builtin_types.entry_invalid; |
| 5358 | } | 5358 | } |
| 5359 | | 5359 | |
| ... | @@ -5398,7 +5398,7 @@ static TypeTableEntry *analyze_builtin_fn_call_expr(CodeGen *g, ImportTableEntry | ... | @@ -5398,7 +5398,7 @@ static TypeTableEntry *analyze_builtin_fn_call_expr(CodeGen *g, ImportTableEntry |
| 5398 | | 5398 | |
| 5399 | if (builtin_fn->param_count != actual_param_count) { | 5399 | if (builtin_fn->param_count != actual_param_count) { |
| 5400 | add_node_error(g, node, | 5400 | add_node_error(g, node, |
| 5401 | buf_sprintf("expected %zu arguments, got %zu", | 5401 | buf_sprintf("expected %zu arguments, found %zu", |
| 5402 | builtin_fn->param_count, actual_param_count)); | 5402 | builtin_fn->param_count, actual_param_count)); |
| 5403 | return g->builtin_types.entry_invalid; | 5403 | return g->builtin_types.entry_invalid; |
| 5404 | } | 5404 | } |
| ... | @@ -5428,7 +5428,7 @@ static TypeTableEntry *analyze_builtin_fn_call_expr(CodeGen *g, ImportTableEntry | ... | @@ -5428,7 +5428,7 @@ static TypeTableEntry *analyze_builtin_fn_call_expr(CodeGen *g, ImportTableEntry |
| 5428 | result_node); | 5428 | result_node); |
| 5429 | } else { | 5429 | } else { |
| 5430 | add_node_error(g, type_node, | 5430 | add_node_error(g, type_node, |
| 5431 | buf_sprintf("expected integer type, got '%s'", buf_ptr(&int_type->name))); | 5431 | buf_sprintf("expected integer type, found '%s'", buf_ptr(&int_type->name))); |
| 5432 | } | 5432 | } |
| 5433 | | 5433 | |
| 5434 | // TODO constant expression evaluation | 5434 | // TODO constant expression evaluation |
| ... | @@ -5448,14 +5448,14 @@ static TypeTableEntry *analyze_builtin_fn_call_expr(CodeGen *g, ImportTableEntry | ... | @@ -5448,14 +5448,14 @@ static TypeTableEntry *analyze_builtin_fn_call_expr(CodeGen *g, ImportTableEntry |
| 5448 | dest_type->id != TypeTableEntryIdPointer) | 5448 | dest_type->id != TypeTableEntryIdPointer) |
| 5449 | { | 5449 | { |
| 5450 | add_node_error(g, dest_node, | 5450 | add_node_error(g, dest_node, |
| 5451 | buf_sprintf("expected pointer argument, got '%s'", buf_ptr(&dest_type->name))); | 5451 | buf_sprintf("expected pointer argument, found '%s'", buf_ptr(&dest_type->name))); |
| 5452 | } | 5452 | } |
| 5453 | | 5453 | |
| 5454 | if (src_type->id != TypeTableEntryIdInvalid && | 5454 | if (src_type->id != TypeTableEntryIdInvalid && |
| 5455 | src_type->id != TypeTableEntryIdPointer) | 5455 | src_type->id != TypeTableEntryIdPointer) |
| 5456 | { | 5456 | { |
| 5457 | add_node_error(g, src_node, | 5457 | add_node_error(g, src_node, |
| 5458 | buf_sprintf("expected pointer argument, got '%s'", buf_ptr(&src_type->name))); | 5458 | buf_sprintf("expected pointer argument, found '%s'", buf_ptr(&src_type->name))); |
| 5459 | } | 5459 | } |
| 5460 | | 5460 | |
| 5461 | if (dest_type->id == TypeTableEntryIdPointer && | 5461 | if (dest_type->id == TypeTableEntryIdPointer && |
| ... | @@ -5486,7 +5486,7 @@ static TypeTableEntry *analyze_builtin_fn_call_expr(CodeGen *g, ImportTableEntry | ... | @@ -5486,7 +5486,7 @@ static TypeTableEntry *analyze_builtin_fn_call_expr(CodeGen *g, ImportTableEntry |
| 5486 | dest_type->id != TypeTableEntryIdPointer) | 5486 | dest_type->id != TypeTableEntryIdPointer) |
| 5487 | { | 5487 | { |
| 5488 | add_node_error(g, dest_node, | 5488 | add_node_error(g, dest_node, |
| 5489 | buf_sprintf("expected pointer argument, got '%s'", buf_ptr(&dest_type->name))); | 5489 | buf_sprintf("expected pointer argument, found '%s'", buf_ptr(&dest_type->name))); |
| 5490 | } | 5490 | } |
| 5491 | | 5491 | |
| 5492 | return builtin_fn->return_type; | 5492 | return builtin_fn->return_type; |
| ... | @@ -5703,7 +5703,7 @@ static TypeTableEntry *analyze_builtin_fn_call_expr(CodeGen *g, ImportTableEntry | ... | @@ -5703,7 +5703,7 @@ static TypeTableEntry *analyze_builtin_fn_call_expr(CodeGen *g, ImportTableEntry |
| 5703 | return resolved_type; | 5703 | return resolved_type; |
| 5704 | } else { | 5704 | } else { |
| 5705 | add_node_error(g, type_node, | 5705 | add_node_error(g, type_node, |
| 5706 | buf_sprintf("expected integer type, got '%s'", buf_ptr(&int_type->name))); | 5706 | buf_sprintf("expected integer type, found '%s'", buf_ptr(&int_type->name))); |
| 5707 | return g->builtin_types.entry_invalid; | 5707 | return g->builtin_types.entry_invalid; |
| 5708 | } | 5708 | } |
| 5709 | } | 5709 | } |
| ... | @@ -5794,12 +5794,12 @@ static TypeTableEntry *analyze_fn_call_ptr(CodeGen *g, ImportTableEntry *import, | ... | @@ -5794,12 +5794,12 @@ static TypeTableEntry *analyze_fn_call_ptr(CodeGen *g, ImportTableEntry *import, |
| 5794 | if (call_param_count < expect_arg_count) { | 5794 | if (call_param_count < expect_arg_count) { |
| 5795 | ok_invocation = false; | 5795 | ok_invocation = false; |
| 5796 | add_node_error(g, node, | 5796 | add_node_error(g, node, |
| 5797 | buf_sprintf("expected at least %zu arguments, got %zu", src_param_count, call_param_count)); | 5797 | buf_sprintf("expected at least %zu arguments, found %zu", src_param_count, call_param_count)); |
| 5798 | } | 5798 | } |
| 5799 | } else if (expect_arg_count != call_param_count) { | 5799 | } else if (expect_arg_count != call_param_count) { |
| 5800 | ok_invocation = false; | 5800 | ok_invocation = false; |
| 5801 | add_node_error(g, node, | 5801 | add_node_error(g, node, |
| 5802 | buf_sprintf("expected %zu arguments, got %zu", expect_arg_count, call_param_count)); | 5802 | buf_sprintf("expected %zu arguments, found %zu", expect_arg_count, call_param_count)); |
| 5803 | } | 5803 | } |
| 5804 | | 5804 | |
| 5805 | bool all_args_const_expr = true; | 5805 | bool all_args_const_expr = true; |
| ... | @@ -5914,7 +5914,7 @@ static TypeTableEntry *analyze_fn_call_with_inline_args(CodeGen *g, ImportTableE | ... | @@ -5914,7 +5914,7 @@ static TypeTableEntry *analyze_fn_call_with_inline_args(CodeGen *g, ImportTableE |
| 5914 | | 5914 | |
| 5915 | if (src_param_count != call_param_count + struct_node_1_or_0) { | 5915 | if (src_param_count != call_param_count + struct_node_1_or_0) { |
| 5916 | add_node_error(g, call_node, | 5916 | add_node_error(g, call_node, |
| 5917 | buf_sprintf("expected %zu arguments, got %zu", src_param_count - struct_node_1_or_0, call_param_count)); | 5917 | buf_sprintf("expected %zu arguments, found %zu", src_param_count - struct_node_1_or_0, call_param_count)); |
| 5918 | return g->builtin_types.entry_invalid; | 5918 | return g->builtin_types.entry_invalid; |
| 5919 | } | 5919 | } |
| 5920 | | 5920 | |
| ... | @@ -6042,7 +6042,7 @@ static TypeTableEntry *analyze_generic_fn_call(CodeGen *g, ImportTableEntry *imp | ... | @@ -6042,7 +6042,7 @@ static TypeTableEntry *analyze_generic_fn_call(CodeGen *g, ImportTableEntry *imp |
| 6042 | | 6042 | |
| 6043 | if (actual_param_count != expected_param_count) { | 6043 | if (actual_param_count != expected_param_count) { |
| 6044 | add_node_error(g, first_executing_node(node), | 6044 | add_node_error(g, first_executing_node(node), |
| 6045 | buf_sprintf("expected %zu arguments, got %zu", expected_param_count, actual_param_count)); | 6045 | buf_sprintf("expected %zu arguments, found %zu", expected_param_count, actual_param_count)); |
| 6046 | return g->builtin_types.entry_invalid; | 6046 | return g->builtin_types.entry_invalid; |
| 6047 | } | 6047 | } |
| 6048 | | 6048 | |
| ... | @@ -6379,7 +6379,7 @@ static TypeTableEntry *analyze_prefix_op_expr(CodeGen *g, ImportTableEntry *impo | ... | @@ -6379,7 +6379,7 @@ static TypeTableEntry *analyze_prefix_op_expr(CodeGen *g, ImportTableEntry *impo |
| 6379 | return type_entry->data.error.child_type; | 6379 | return type_entry->data.error.child_type; |
| 6380 | } else { | 6380 | } else { |
| 6381 | add_node_error(g, *expr_node, | 6381 | add_node_error(g, *expr_node, |
| 6382 | buf_sprintf("expected error type, got '%s'", buf_ptr(&type_entry->name))); | 6382 | buf_sprintf("expected error type, found '%s'", buf_ptr(&type_entry->name))); |
| 6383 | return g->builtin_types.entry_invalid; | 6383 | return g->builtin_types.entry_invalid; |
| 6384 | } | 6384 | } |
| 6385 | } | 6385 | } |
| ... | @@ -6393,7 +6393,7 @@ static TypeTableEntry *analyze_prefix_op_expr(CodeGen *g, ImportTableEntry *impo | ... | @@ -6393,7 +6393,7 @@ static TypeTableEntry *analyze_prefix_op_expr(CodeGen *g, ImportTableEntry *impo |
| 6393 | return type_entry->data.maybe.child_type; | 6393 | return type_entry->data.maybe.child_type; |
| 6394 | } else { | 6394 | } else { |
| 6395 | add_node_error(g, *expr_node, | 6395 | add_node_error(g, *expr_node, |
| 6396 | buf_sprintf("expected maybe type, got '%s'", buf_ptr(&type_entry->name))); | 6396 | buf_sprintf("expected maybe type, found '%s'", buf_ptr(&type_entry->name))); |
| 6397 | return g->builtin_types.entry_invalid; | 6397 | return g->builtin_types.entry_invalid; |
| 6398 | } | 6398 | } |
| 6399 | } | 6399 | } |
| ... | @@ -6689,7 +6689,7 @@ static TypeTableEntry *analyze_return_expr(CodeGen *g, ImportTableEntry *import, | ... | @@ -6689,7 +6689,7 @@ static TypeTableEntry *analyze_return_expr(CodeGen *g, ImportTableEntry *import, |
| 6689 | return resolved_type->data.error.child_type; | 6689 | return resolved_type->data.error.child_type; |
| 6690 | } else { | 6690 | } else { |
| 6691 | add_node_error(g, node->data.return_expr.expr, | 6691 | add_node_error(g, node->data.return_expr.expr, |
| 6692 | buf_sprintf("expected error type, got '%s'", buf_ptr(&resolved_type->name))); | 6692 | buf_sprintf("expected error type, found '%s'", buf_ptr(&resolved_type->name))); |
| 6693 | return g->builtin_types.entry_invalid; | 6693 | return g->builtin_types.entry_invalid; |
| 6694 | } | 6694 | } |
| 6695 | } | 6695 | } |
| ... | @@ -6717,7 +6717,7 @@ static TypeTableEntry *analyze_return_expr(CodeGen *g, ImportTableEntry *import, | ... | @@ -6717,7 +6717,7 @@ static TypeTableEntry *analyze_return_expr(CodeGen *g, ImportTableEntry *import, |
| 6717 | return resolved_type->data.maybe.child_type; | 6717 | return resolved_type->data.maybe.child_type; |
| 6718 | } else { | 6718 | } else { |
| 6719 | add_node_error(g, node->data.return_expr.expr, | 6719 | add_node_error(g, node->data.return_expr.expr, |
| 6720 | buf_sprintf("expected maybe type, got '%s'", buf_ptr(&resolved_type->name))); | 6720 | buf_sprintf("expected maybe type, found '%s'", buf_ptr(&resolved_type->name))); |
| 6721 | return g->builtin_types.entry_invalid; | 6721 | return g->builtin_types.entry_invalid; |
| 6722 | } | 6722 | } |
| 6723 | } | 6723 | } |