← Back to context Comment by always_good 8 years ago If if/else is an expression, what would be the return type of `if (true) { 42 }`? 1 comment always_good Reply klibertp 8 years ago int option which is basically a variant/union like this: Result of 'a | Void You could also have a `discard` or `ignore` function/operator, which can swallow every type, so it doesn't matter what it was. Some languages actually require you to use such operators, for example, Nim and F#.
klibertp 8 years ago int option which is basically a variant/union like this: Result of 'a | Void You could also have a `discard` or `ignore` function/operator, which can swallow every type, so it doesn't matter what it was. Some languages actually require you to use such operators, for example, Nim and F#.
which is basically a variant/union like this:
You could also have a `discard` or `ignore` function/operator, which can swallow every type, so it doesn't matter what it was. Some languages actually require you to use such operators, for example, Nim and F#.