authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-01-28 14:17:25-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-01-28 14:17:25-05:00
log504ce86ac991938fcd0544d771c7743833060dda
treeb79e8729f96d16ad6d89aeeb2b9f2f2dd8a4fd1a
parent793d81c4e8b75a8a3d8f51917af6634213b7cabc
signaturelock-open Commit is signed but in an unrecognized format.

fix more compile error test regressions


3 files changed, 55 insertions(+), 40 deletions(-)

src/all_types.hpp+1
......@@ -317,6 +317,7 @@ struct ConstErrValue {
317317struct ConstBoundFnValue {
318318 ZigFn *fn;
319319 IrInstGen *first_arg;
320 IrInst *first_arg_src;
320321};
321322
322323struct ConstArgTuple {
src/ir.cpp+48-33
......@@ -218,7 +218,8 @@ static IrInstGen *ir_get_deref(IrAnalyze *ira, IrInst *source_instr, IrInstGen *
218218 ResultLoc *result_loc);
219219static ErrorMsg *exec_add_error_node(CodeGen *codegen, IrExecutableSrc *exec, AstNode *source_node, Buf *msg);
220220static IrInstGen *ir_analyze_container_field_ptr(IrAnalyze *ira, Buf *field_name,
221 IrInst* source_instr, IrInstGen *container_ptr, ZigType *container_type, bool initializing);
221 IrInst* source_instr, IrInstGen *container_ptr, IrInst *container_ptr_src,
222 ZigType *container_type, bool initializing);
222223static void ir_assert(bool ok, IrInst* source_instruction);
223224static void ir_assert_gen(bool ok, IrInstGen *source_instruction);
224225static IrInstGen *ir_get_var_ptr(IrAnalyze *ira, IrInst *source_instr, ZigVar *var);
......@@ -13040,10 +13041,13 @@ static IrInstGen *ir_const_fn(IrAnalyze *ira, IrInst *source_instr, ZigFn *fn_en
1304013041 return result;
1304113042}
1304213043
13043static IrInstGen *ir_const_bound_fn(IrAnalyze *ira, IrInst *src_inst, ZigFn *fn_entry, IrInstGen *first_arg) {
13044static IrInstGen *ir_const_bound_fn(IrAnalyze *ira, IrInst *src_inst, ZigFn *fn_entry, IrInstGen *first_arg,
13045 IrInst *first_arg_src)
13046{
1304413047 IrInstGen *result = ir_const(ira, src_inst, get_bound_fn_type(ira->codegen, fn_entry));
1304513048 result->value->data.x_bound_fn.fn = fn_entry;
1304613049 result->value->data.x_bound_fn.first_arg = first_arg;
13050 result->value->data.x_bound_fn.first_arg_src = first_arg_src;
1304713051 return result;
1304813052}
1304913053
......@@ -15481,7 +15485,7 @@ static IrInstGen *ir_analyze_instruction_return(IrAnalyze *ira, IrInstSrcReturn
1548115485 casted_operand->value->type->id == ZigTypeIdPointer &&
1548215486 casted_operand->value->data.rh_ptr == RuntimeHintPtrStack)
1548315487 {
15484 ir_add_error(ira, &casted_operand->base, buf_sprintf("function returns address of local variable"));
15488 ir_add_error(ira, &instruction->operand->base, buf_sprintf("function returns address of local variable"));
1548515489 return ir_unreach_error(ira);
1548615490 }
1548715491
......@@ -18895,7 +18899,7 @@ static bool ir_analyze_fn_call_inline_arg(IrAnalyze *ira, AstNode *fn_proto_node
1889518899}
1889618900
1889718901static bool ir_analyze_fn_call_generic_arg(IrAnalyze *ira, AstNode *fn_proto_node,
18898 IrInstGen *arg, Scope **child_scope, size_t *next_proto_i,
18902 IrInstGen *arg, IrInst *arg_src, Scope **child_scope, size_t *next_proto_i,
1889918903 GenericFnTypeId *generic_id, FnTypeId *fn_type_id, IrInstGen **casted_args,
1890018904 ZigFn *impl_fn)
1890118905{
......@@ -18914,7 +18918,7 @@ static bool ir_analyze_fn_call_generic_arg(IrAnalyze *ira, AstNode *fn_proto_nod
1891418918 if (type_is_invalid(param_type))
1891518919 return false;
1891618920
18917 casted_arg = ir_implicit_cast(ira, arg, param_type);
18921 casted_arg = ir_implicit_cast2(ira, arg_src, arg, param_type);
1891818922 if (type_is_invalid(casted_arg->value->type))
1891918923 return false;
1892018924 } else {
......@@ -19201,7 +19205,7 @@ static IrInstGen *analyze_casted_new_stack(IrAnalyze *ira, IrInst* source_instr,
1920119205
1920219206static IrInstGen *ir_analyze_fn_call(IrAnalyze *ira, IrInst* source_instr,
1920319207 ZigFn *fn_entry, ZigType *fn_type, IrInstGen *fn_ref,
19204 IrInstGen *first_arg_ptr, CallModifier modifier,
19208 IrInstGen *first_arg_ptr, IrInst *first_arg_ptr_src, CallModifier modifier,
1920519209 IrInstGen *new_stack, IrInst *new_stack_src, bool is_async_call_builtin,
1920619210 IrInstGen **args_ptr, size_t args_len, IrInstGen *ret_ptr, ResultLoc *call_result_loc)
1920719211{
......@@ -19416,8 +19420,8 @@ static IrInstGen *ir_analyze_fn_call(IrAnalyze *ira, IrInst* source_instr,
1941619420 return ira->codegen->invalid_inst_gen;
1941719421 }
1941819422
19419 if (!ir_analyze_fn_call_generic_arg(ira, fn_proto_node, first_arg, &impl_fn->child_scope,
19420 &next_proto_i, generic_id, &inst_fn_type_id, casted_args, impl_fn))
19423 if (!ir_analyze_fn_call_generic_arg(ira, fn_proto_node, first_arg, first_arg_ptr_src,
19424 &impl_fn->child_scope, &next_proto_i, generic_id, &inst_fn_type_id, casted_args, impl_fn))
1942119425 {
1942219426 return ira->codegen->invalid_inst_gen;
1942319427 }
......@@ -19431,7 +19435,7 @@ static IrInstGen *ir_analyze_fn_call(IrAnalyze *ira, IrInst* source_instr,
1943119435 AstNode *param_decl_node = fn_proto_node->data.fn_proto.params.at(next_proto_i);
1943219436 assert(param_decl_node->type == NodeTypeParamDecl);
1943319437
19434 if (!ir_analyze_fn_call_generic_arg(ira, fn_proto_node, arg, &impl_fn->child_scope,
19438 if (!ir_analyze_fn_call_generic_arg(ira, fn_proto_node, arg, &arg->base, &impl_fn->child_scope,
1943519439 &next_proto_i, generic_id, &inst_fn_type_id, casted_args, impl_fn))
1943619440 {
1943719441 return ira->codegen->invalid_inst_gen;
......@@ -19479,7 +19483,7 @@ static IrInstGen *ir_analyze_fn_call(IrAnalyze *ira, IrInst* source_instr,
1947919483 case ReqCompTimeYes:
1948019484 // Throw out our work and call the function as if it were comptime.
1948119485 return ir_analyze_fn_call(ira, source_instr, fn_entry, fn_type, fn_ref, first_arg_ptr,
19482 CallModifierCompileTime, new_stack, new_stack_src, is_async_call_builtin,
19486 first_arg_ptr_src, CallModifierCompileTime, new_stack, new_stack_src, is_async_call_builtin,
1948319487 args_ptr, args_len, ret_ptr, call_result_loc);
1948419488 case ReqCompTimeInvalid:
1948519489 return ira->codegen->invalid_inst_gen;
......@@ -19600,7 +19604,7 @@ static IrInstGen *ir_analyze_fn_call(IrAnalyze *ira, IrInst* source_instr,
1960019604 return ira->codegen->invalid_inst_gen;
1960119605 }
1960219606
19603 IrInstGen *casted_arg = ir_implicit_cast(ira, first_arg, param_type);
19607 IrInstGen *casted_arg = ir_implicit_cast2(ira, first_arg_ptr_src, first_arg, param_type);
1960419608 if (type_is_invalid(casted_arg->value->type))
1960519609 return ira->codegen->invalid_inst_gen;
1960619610
......@@ -19696,7 +19700,7 @@ static IrInstGen *ir_analyze_fn_call(IrAnalyze *ira, IrInst* source_instr,
1969619700
1969719701static IrInstGen *ir_analyze_fn_call_src(IrAnalyze *ira, IrInstSrcCall *call_instruction,
1969819702 ZigFn *fn_entry, ZigType *fn_type, IrInstGen *fn_ref,
19699 IrInstGen *first_arg_ptr, CallModifier modifier)
19703 IrInstGen *first_arg_ptr, IrInst *first_arg_ptr_src, CallModifier modifier)
1970019704{
1970119705 IrInstGen *new_stack = nullptr;
1970219706 IrInst *new_stack_src = nullptr;
......@@ -19719,8 +19723,9 @@ static IrInstGen *ir_analyze_fn_call_src(IrAnalyze *ira, IrInstSrcCall *call_ins
1971919723 return ira->codegen->invalid_inst_gen;
1972019724 }
1972119725 IrInstGen *result = ir_analyze_fn_call(ira, &call_instruction->base.base, fn_entry, fn_type, fn_ref,
19722 first_arg_ptr, modifier, new_stack, new_stack_src, call_instruction->is_async_call_builtin,
19723 args_ptr, call_instruction->arg_count, ret_ptr, call_instruction->result_loc);
19726 first_arg_ptr, first_arg_ptr_src, modifier, new_stack, new_stack_src,
19727 call_instruction->is_async_call_builtin, args_ptr, call_instruction->arg_count, ret_ptr,
19728 call_instruction->result_loc);
1972419729 deallocate(args_ptr, call_instruction->arg_count, "IrInstGen *");
1972519730 return result;
1972619731}
......@@ -19771,12 +19776,14 @@ static IrInstGen *ir_analyze_call_extra(IrAnalyze *ira, IrInst* source_instr,
1977119776 }
1977219777
1977319778 IrInstGen *first_arg_ptr = nullptr;
19779 IrInst *first_arg_ptr_src = nullptr;
1977419780 ZigFn *fn = nullptr;
1977519781 if (instr_is_comptime(fn_ref)) {
1977619782 if (fn_ref->value->type->id == ZigTypeIdBoundFn) {
1977719783 assert(fn_ref->value->special == ConstValSpecialStatic);
1977819784 fn = fn_ref->value->data.x_bound_fn.fn;
1977919785 first_arg_ptr = fn_ref->value->data.x_bound_fn.first_arg;
19786 first_arg_ptr_src = fn_ref->value->data.x_bound_fn.first_arg_src;
1978019787 if (type_is_invalid(first_arg_ptr->value->type))
1978119788 return ira->codegen->invalid_inst_gen;
1978219789 } else {
......@@ -19818,7 +19825,7 @@ static IrInstGen *ir_analyze_call_extra(IrAnalyze *ira, IrInst* source_instr,
1981819825 return ira->codegen->invalid_inst_gen;
1981919826 }
1982019827
19821 return ir_analyze_fn_call(ira, source_instr, fn, fn_type, fn_ref, first_arg_ptr,
19828 return ir_analyze_fn_call(ira, source_instr, fn, fn_type, fn_ref, first_arg_ptr, first_arg_ptr_src,
1982219829 modifier, stack, &stack->base, false, args_ptr, args_len, nullptr, result_loc);
1982319830}
1982419831
......@@ -19894,14 +19901,15 @@ static IrInstGen *ir_analyze_instruction_call(IrAnalyze *ira, IrInstSrcCall *cal
1989419901 ZigType *fn_type = fn_table_entry ? fn_table_entry->type_entry : fn_ref->value->type;
1989519902 CallModifier modifier = is_comptime ? CallModifierCompileTime : call_instruction->modifier;
1989619903 return ir_analyze_fn_call_src(ira, call_instruction, fn_table_entry, fn_type,
19897 fn_ref, nullptr, modifier);
19904 fn_ref, nullptr, nullptr, modifier);
1989819905 } else if (fn_ref->value->type->id == ZigTypeIdBoundFn) {
1989919906 assert(fn_ref->value->special == ConstValSpecialStatic);
1990019907 ZigFn *fn_table_entry = fn_ref->value->data.x_bound_fn.fn;
1990119908 IrInstGen *first_arg_ptr = fn_ref->value->data.x_bound_fn.first_arg;
19909 IrInst *first_arg_ptr_src = fn_ref->value->data.x_bound_fn.first_arg_src;
1990219910 CallModifier modifier = is_comptime ? CallModifierCompileTime : call_instruction->modifier;
1990319911 return ir_analyze_fn_call_src(ira, call_instruction, fn_table_entry, fn_table_entry->type_entry,
19904 fn_ref, first_arg_ptr, modifier);
19912 fn_ref, first_arg_ptr, first_arg_ptr_src, modifier);
1990519913 } else {
1990619914 ir_add_error(ira, &fn_ref->base,
1990719915 buf_sprintf("type '%s' not a function", buf_ptr(&fn_ref->value->type->name)));
......@@ -19911,7 +19919,7 @@ static IrInstGen *ir_analyze_instruction_call(IrAnalyze *ira, IrInstSrcCall *cal
1991119919
1991219920 if (fn_ref->value->type->id == ZigTypeIdFn) {
1991319921 return ir_analyze_fn_call_src(ira, call_instruction, nullptr, fn_ref->value->type,
19914 fn_ref, nullptr, modifier);
19922 fn_ref, nullptr, nullptr, modifier);
1991519923 } else {
1991619924 ir_add_error(ira, &fn_ref->base,
1991719925 buf_sprintf("type '%s' not a function", buf_ptr(&fn_ref->value->type->name)));
......@@ -21009,7 +21017,7 @@ static IrInstGen *ir_analyze_instruction_elem_ptr(IrAnalyze *ira, IrInstSrcElemP
2100921017
2101021018static IrInstGen *ir_analyze_container_member_access_inner(IrAnalyze *ira,
2101121019 ZigType *bare_struct_type, Buf *field_name, IrInst* source_instr,
21012 IrInstGen *container_ptr, ZigType *container_type)
21020 IrInstGen *container_ptr, IrInst *container_ptr_src, ZigType *container_type)
2101321021{
2101421022 if (!is_slice(bare_struct_type)) {
2101521023 ScopeDecls *container_scope = get_container_scope(bare_struct_type);
......@@ -21030,7 +21038,8 @@ static IrInstGen *ir_analyze_container_member_access_inner(IrAnalyze *ira,
2103021038 if (type_is_invalid(fn_entry->type_entry))
2103121039 return ira->codegen->invalid_inst_gen;
2103221040
21033 IrInstGen *bound_fn_value = ir_const_bound_fn(ira, source_instr, fn_entry, container_ptr);
21041 IrInstGen *bound_fn_value = ir_const_bound_fn(ira, source_instr, fn_entry, container_ptr,
21042 container_ptr_src);
2103421043 return ir_get_ref(ira, source_instr, bound_fn_value, true, false);
2103521044 } else if (tld->id == TldIdVar) {
2103621045 resolve_top_level_decl(ira->codegen, tld, source_instr->source_node, false);
......@@ -21049,7 +21058,8 @@ static IrInstGen *ir_analyze_container_member_access_inner(IrAnalyze *ira,
2104921058 if (var->const_value->type->id == ZigTypeIdFn) {
2105021059 ir_assert(var->const_value->data.x_ptr.special == ConstPtrSpecialFunction, source_instr);
2105121060 ZigFn *fn = var->const_value->data.x_ptr.data.fn.fn_entry;
21052 IrInstGen *bound_fn_value = ir_const_bound_fn(ira, source_instr, fn, container_ptr);
21061 IrInstGen *bound_fn_value = ir_const_bound_fn(ira, source_instr, fn, container_ptr,
21062 container_ptr_src);
2105321063 return ir_get_ref(ira, source_instr, bound_fn_value, true, false);
2105421064 }
2105521065 }
......@@ -21213,7 +21223,8 @@ static IrInstGen *ir_analyze_inferred_field_ptr(IrAnalyze *ira, Buf *field_name,
2121321223}
2121421224
2121521225static IrInstGen *ir_analyze_container_field_ptr(IrAnalyze *ira, Buf *field_name,
21216 IrInst* source_instr, IrInstGen *container_ptr, ZigType *container_type, bool initializing)
21226 IrInst* source_instr, IrInstGen *container_ptr, IrInst *container_ptr_src,
21227 ZigType *container_type, bool initializing)
2121721228{
2121821229 Error err;
2121921230
......@@ -21235,13 +21246,13 @@ static IrInstGen *ir_analyze_container_field_ptr(IrAnalyze *ira, Buf *field_name
2123521246 return ir_analyze_struct_field_ptr(ira, source_instr, field, container_ptr, bare_type, initializing);
2123621247 } else {
2123721248 return ir_analyze_container_member_access_inner(ira, bare_type, field_name,
21238 source_instr, container_ptr, container_type);
21249 source_instr, container_ptr, container_ptr_src, container_type);
2123921250 }
2124021251 }
2124121252
2124221253 if (bare_type->id == ZigTypeIdEnum) {
2124321254 return ir_analyze_container_member_access_inner(ira, bare_type, field_name,
21244 source_instr, container_ptr, container_type);
21255 source_instr, container_ptr, container_ptr_src, container_type);
2124521256 }
2124621257
2124721258 if (bare_type->id == ZigTypeIdUnion) {
......@@ -21251,7 +21262,7 @@ static IrInstGen *ir_analyze_container_field_ptr(IrAnalyze *ira, Buf *field_name
2125121262 TypeUnionField *field = find_union_type_field(bare_type, field_name);
2125221263 if (field == nullptr) {
2125321264 return ir_analyze_container_member_access_inner(ira, bare_type, field_name,
21254 source_instr, container_ptr, container_type);
21265 source_instr, container_ptr, container_ptr_src, container_type);
2125521266 }
2125621267
2125721268 ZigType *field_type = resolve_union_field_type(ira->codegen, field);
......@@ -21445,10 +21456,14 @@ static IrInstGen *ir_analyze_instruction_field_ptr(IrAnalyze *ira, IrInstSrcFiel
2144521456 if (container_type->id == ZigTypeIdPointer) {
2144621457 ZigType *bare_type = container_ref_type(container_type);
2144721458 IrInstGen *container_child = ir_get_deref(ira, &field_ptr_instruction->base.base, container_ptr, nullptr);
21448 IrInstGen *result = ir_analyze_container_field_ptr(ira, field_name, &field_ptr_instruction->base.base, container_child, bare_type, field_ptr_instruction->initializing);
21459 IrInstGen *result = ir_analyze_container_field_ptr(ira, field_name, &field_ptr_instruction->base.base,
21460 container_child, &field_ptr_instruction->container_ptr->base, bare_type,
21461 field_ptr_instruction->initializing);
2144921462 return result;
2145021463 } else {
21451 IrInstGen *result = ir_analyze_container_field_ptr(ira, field_name, &field_ptr_instruction->base.base, container_ptr, container_type, field_ptr_instruction->initializing);
21464 IrInstGen *result = ir_analyze_container_field_ptr(ira, field_name, &field_ptr_instruction->base.base,
21465 container_ptr, &field_ptr_instruction->container_ptr->base, container_type,
21466 field_ptr_instruction->initializing);
2145221467 return result;
2145321468 }
2145421469 } else if (is_array_ref(container_type) && !field_ptr_instruction->initializing) {
......@@ -25096,7 +25111,7 @@ static IrInstGen *ir_analyze_instruction_cmpxchg(IrAnalyze *ira, IrInstSrcCmpxch
2509625111
2509725112 // TODO let this be volatile
2509825113 ZigType *ptr_type = get_pointer_to_type(ira->codegen, operand_type, false);
25099 IrInstGen *casted_ptr = ir_implicit_cast(ira, ptr, ptr_type);
25114 IrInstGen *casted_ptr = ir_implicit_cast2(ira, &instruction->ptr->base, ptr, ptr_type);
2510025115 if (type_is_invalid(casted_ptr->value->type))
2510125116 return ira->codegen->invalid_inst_gen;
2510225117
......@@ -25124,11 +25139,11 @@ static IrInstGen *ir_analyze_instruction_cmpxchg(IrAnalyze *ira, IrInstSrcCmpxch
2512425139 if (!ir_resolve_atomic_order(ira, failure_order_value, &failure_order))
2512525140 return ira->codegen->invalid_inst_gen;
2512625141
25127 IrInstGen *casted_cmp_value = ir_implicit_cast(ira, cmp_value, operand_type);
25142 IrInstGen *casted_cmp_value = ir_implicit_cast2(ira, &instruction->cmp_value->base, cmp_value, operand_type);
2512825143 if (type_is_invalid(casted_cmp_value->value->type))
2512925144 return ira->codegen->invalid_inst_gen;
2513025145
25131 IrInstGen *casted_new_value = ir_implicit_cast(ira, new_value, operand_type);
25146 IrInstGen *casted_new_value = ir_implicit_cast2(ira, &instruction->new_value->base, new_value, operand_type);
2513225147 if (type_is_invalid(casted_new_value->value->type))
2513325148 return ira->codegen->invalid_inst_gen;
2513425149
......@@ -25219,7 +25234,7 @@ static IrInstGen *ir_analyze_instruction_truncate(IrAnalyze *ira, IrInstSrcTrunc
2521925234 }
2522025235
2522125236 if (dest_type->id == ZigTypeIdComptimeInt) {
25222 return ir_implicit_cast(ira, target, dest_type);
25237 return ir_implicit_cast2(ira, &instruction->target->base, target, dest_type);
2522325238 }
2522425239
2522525240 if (instr_is_comptime(target)) {
......@@ -25273,7 +25288,7 @@ static IrInstGen *ir_analyze_instruction_int_cast(IrAnalyze *ira, IrInstSrcIntCa
2527325288 }
2527425289
2527525290 if (instr_is_comptime(target)) {
25276 return ir_implicit_cast(ira, target, dest_type);
25291 return ir_implicit_cast2(ira, &instruction->target->base, target, dest_type);
2527725292 }
2527825293
2527925294 if (dest_type->id == ZigTypeIdComptimeInt) {
......@@ -25401,7 +25416,7 @@ static IrInstGen *ir_analyze_instruction_from_bytes(IrAnalyze *ira, IrInstSrcFro
2540125416 src_ptr_align, 0, 0, false);
2540225417 ZigType *u8_slice = get_slice_type(ira->codegen, u8_ptr);
2540325418
25404 IrInstGen *casted_value = ir_implicit_cast(ira, target, u8_slice);
25419 IrInstGen *casted_value = ir_implicit_cast2(ira, &instruction->target->base, target, u8_slice);
2540525420 if (type_is_invalid(casted_value->value->type))
2540625421 return ira->codegen->invalid_inst_gen;
2540725422
test/compile_errors.zig+6-7
......@@ -1658,7 +1658,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
16581658 cases.addTest("return invalid type from test",
16591659 \\test "example" { return 1; }
16601660 , &[_][]const u8{
1661 "tmp.zig:1:25: error: integer value 1 cannot be coerced to type 'void'",
1661 "tmp.zig:1:25: error: expected type 'void', found 'comptime_int'",
16621662 });
16631663
16641664 cases.add("threadlocal qualifier on const",
......@@ -2487,7 +2487,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
24872487 \\ var rule_set = try Foo.init();
24882488 \\}
24892489 , &[_][]const u8{
2490 "tmp.zig:2:10: error: expected type 'i32', found 'type'",
2490 "tmp.zig:2:19: error: expected type 'i32', found 'type'",
24912491 });
24922492
24932493 cases.add("slicing single-item pointer",
......@@ -3393,7 +3393,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
33933393 \\
33943394 \\fn b() void {}
33953395 , &[_][]const u8{
3396 "tmp.zig:3:6: error: unreachable code",
3396 "tmp.zig:3:5: error: unreachable code",
33973397 });
33983398
33993399 cases.add("bad import",
......@@ -4011,8 +4011,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
40114011 \\
40124012 \\export fn entry() usize { return @sizeOf(@TypeOf(Foo)); }
40134013 , &[_][]const u8{
4014 "tmp.zig:5:25: error: unable to evaluate constant expression",
4015 "tmp.zig:2:12: note: referenced here",
4014 "tmp.zig:5:25: error: cannot store runtime value in compile time variable",
4015 "tmp.zig:2:12: note: called from here",
40164016 });
40174017
40184018 cases.add("addition with non numbers",
......@@ -4652,7 +4652,6 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
46524652 \\fn something() anyerror!void { }
46534653 , &[_][]const u8{
46544654 "tmp.zig:2:5: error: expected type 'void', found 'anyerror'",
4655 "tmp.zig:1:15: note: return type declared here",
46564655 });
46574656
46584657 cases.add("invalid pointer for var type",
......@@ -5743,7 +5742,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
57435742 \\ @export(entry, .{.name = "entry", .linkage = @as(u32, 1234) });
57445743 \\}
57455744 , &[_][]const u8{
5746 "tmp.zig:3:50: error: expected type 'std.builtin.GlobalLinkage', found 'u32'",
5745 "tmp.zig:3:59: error: expected type 'std.builtin.GlobalLinkage', found 'comptime_int'",
57475746 });
57485747
57495748 cases.add("struct with invalid field",