Skip to content

Commit

Permalink
fix error message mentioning unreachable instead of noreturn
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrk committed Jan 31, 2018
1 parent 3ef6a00 commit 40ca39d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ir.cpp
Expand Up @@ -7009,7 +7009,7 @@ static IrInstruction *ir_get_const_ptr(IrAnalyze *ira, IrInstruction *instructio
if (pointee_type->id == TypeTableEntryIdMetaType) {
TypeTableEntry *type_entry = pointee->data.x_type;
if (type_entry->id == TypeTableEntryIdUnreachable) {
ir_add_error(ira, instruction, buf_sprintf("pointer to unreachable not allowed"));
ir_add_error(ira, instruction, buf_sprintf("pointer to noreturn not allowed"));
return ira->codegen->invalid_instruction;
}

Expand Down
4 changes: 2 additions & 2 deletions test/compile_errors.zig
Expand Up @@ -372,10 +372,10 @@ pub fn addCases(cases: &tests.CompileErrorContext) void {
\\export fn entry() void { _ = a(); }
, ".tmp_source.zig:1:8: error: use of undeclared identifier 'bogus'");

cases.add("pointer to unreachable",
cases.add("pointer to noreturn",
\\fn a() &noreturn {}
\\export fn entry() void { _ = a(); }
, ".tmp_source.zig:1:9: error: pointer to unreachable not allowed");
, ".tmp_source.zig:1:9: error: pointer to noreturn not allowed");

cases.add("unreachable code",
\\export fn a() void {
Expand Down

0 comments on commit 40ca39d

Please sign in to comment.