aboutsummaryrefslogtreecommitdiff
path: root/test/cases/errors.1.zig
blob: 5f9582df8a1e9fd2331c1c4aaf1a5792f7bef49e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
const std = @import("std");

pub fn main() void {
    foo() catch print();
}

fn foo() anyerror!void {
    return error.Test;
}

fn print() void {
    _ = std.os.write(1, "Hello, World!\n") catch {};
}

// run
//
// Hello, World!
//