zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

handle_error_with_catch_block.zig.zig (256B) - Raw


      1 const parseU64 = @import("error_union_parsing_u64.zig").parseU64;
      2 
      3 fn doAThing(str: []u8) void {
      4     const number = parseU64(str, 10) catch blk: {
      5         // do things
      6         break :blk 13;
      7     };
      8     _ = number; // number is now initialized
      9 }
     10 
     11 // syntax