2 ms·
Sum types having zero values seems to be breaking the promise that people hoped out of them. use fmt enum Coin { Penny, Nickel,
by yencabulator 3y ago
Sum types having zero values seems to be breaking the promise that people hoped out of them.
use fmt
enum Coin {
Penny,
Nickel,
Dime,
Quarter,
}
fn wtf() -> Coin {
return zeroValue()
}
fn main() {
let coin = wtf()
fmt.Println("zero coin:", coin)
}
Output:
zero coin: {0}