Created
May 15, 2019 14:56
-
-
Save kristoff-it/3209b6c243643fbcdfbd25c3d38d79d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
pub fn main() !void { | |
const oh = error { | |
no, | |
}; | |
var x: oh!u8 = oh.no; | |
if (x) |_| { | |
std.debug.warn("got the value"); | |
} else |err| switch (err) { | |
oh.no => std.debug.warn("oh no!"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment