-
-
Save koljakube/282ba3362edad66fa160d65e67f081cf 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
fn Awesome(comptime b: bool) type { | |
return struct { | |
usingnamespace if (b) | |
struct { | |
pub fn foo() void { | |
std.debug.warn("wowser.\n", .{}); | |
} | |
} | |
// else struct { | |
// } | |
; | |
}; | |
} | |
pub fn main() void { | |
const a = Awesome(true); | |
a.foo(); | |
// const b = Awesome(false); | |
// b.foo(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment