diff --git a/example/cat/main.zig b/example/cat/main.zig index fa45f2a8eeaee3f5de5cdebbe62ecb33bd918b9e..1f600843bae36be5e571a4fe382562484c3a4965 100644 --- a/example/cat/main.zig +++ b/example/cat/main.zig @@ -17,7 +17,7 @@ pub fn main(args: [][]u8) -> %void { var is: io.InStream = undefined; is.open(arg) %% |err| { %%io.stderr.printf("Unable to open file: "); - %%io.stderr.printf(@errName(err)); + %%io.stderr.printf(@errorName(err)); %%io.stderr.printf("\n"); return err; }; @@ -46,7 +46,7 @@ fn cat_stream(is: io.InStream) -> %void { while (true) { const bytes_read = is.read(buf) %% |err| { %%io.stderr.printf("Unable to read from stream: "); - %%io.stderr.printf(@errName(err)); + %%io.stderr.printf(@errorName(err)); %%io.stderr.printf("\n"); return err; }; @@ -57,7 +57,7 @@ fn cat_stream(is: io.InStream) -> %void { io.stdout.write(buf[0...bytes_read]) %% |err| { %%io.stderr.printf("Unable to write to stdout: "); - %%io.stderr.printf(@errName(err)); + %%io.stderr.printf(@errorName(err)); %%io.stderr.printf("\n"); return err; }; diff --git a/example/guess_number/main.zig b/example/guess_number/main.zig index 61421b9c822eb256f3169accdbde68e54e9a5224..30a51eab0989c4bb90c16070f8f1a838f7ed976b 100644 --- a/example/guess_number/main.zig +++ b/example/guess_number/main.zig @@ -19,7 +19,7 @@ pub fn main(args: [][]u8) -> %void { const line_len = io.stdin.read(line_buf) %% |err| { %%io.stdout.printf("Unable to read from stdin: "); - %%io.stdout.printf(@errName(err)); + %%io.stdout.printf(@errorName(err)); %%io.stdout.printf("\n"); return err; }; diff --git a/src/codegen.cpp b/src/codegen.cpp index b7233fc63d36832c12e71ab7ad1b274c55db7798..c581bccbf3c01fb9e0bbda9b460070af02d3ccce 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -4843,7 +4843,7 @@ static void define_builtin_fns(CodeGen *g) { create_builtin_fn_with_arg_count(g, BuiltinFnIdClz, "clz", 2); create_builtin_fn_with_arg_count(g, BuiltinFnIdImport, "import", 1); create_builtin_fn_with_arg_count(g, BuiltinFnIdCImport, "cImport", 1); - create_builtin_fn_with_arg_count(g, BuiltinFnIdErrName, "errName", 1); + create_builtin_fn_with_arg_count(g, BuiltinFnIdErrName, "errorName", 1); create_builtin_fn_with_arg_count(g, BuiltinFnIdEmbedFile, "embedFile", 1); create_builtin_fn_with_arg_count(g, BuiltinFnIdCmpExchange, "cmpxchg", 5); create_builtin_fn_with_arg_count(g, BuiltinFnIdFence, "fence", 1); diff --git a/std/mem.zig b/std/mem.zig index 8044eddb0986e8195e943c771e14dabebfb7822b..aadbbbcb4996218bdd5f5deb7d5ec7c8f150b0ed 100644 --- a/std/mem.zig +++ b/std/mem.zig @@ -19,7 +19,7 @@ pub struct Allocator { alloc(self, T, n) %% |err| { // TODO var args printf %%io.stderr.write("allocation failure: "); - %%io.stderr.write(@errName(err)); + %%io.stderr.write(@errorName(err)); %%io.stderr.printf("\n"); os.abort() } diff --git a/test/self_hosted.zig b/test/self_hosted.zig index e561eefbed87be1cd102f4cf5e130eda5c2be61d..930a6a8fa99b1db974283c2d1aa2bea97476dfd2 100644 --- a/test/self_hosted.zig +++ b/test/self_hosted.zig @@ -766,8 +766,8 @@ error AnError; error ALongerErrorName; #attribute("test") fn errorNameString() { - assert(str.eql(@errName(error.AnError), "AnError")); - assert(str.eql(@errName(error.ALongerErrorName), "ALongerErrorName")); + assert(str.eql(@errorName(error.AnError), "AnError")); + assert(str.eql(@errorName(error.ALongerErrorName), "ALongerErrorName")); }