|
|
|
|
|
by xavxav
1324 days ago
|
|
I know that this is a common wish, but anonymous sum types have pretty catastrophic impacts on type checking and lead to all sorts of bizarre corner cases like the following: let a = if cond {
1
} else {
1.0
};
a + 3
Now, the error would be pushed to the `+` operator because there isn't an `Add` for `f32 | u32`. Granted, this is a trivial example, and a programmer can easily see through it, but in general this can get very overwhelming and cause errors to leave their 'root cause'. |
|
[0] https://news.ycombinator.com/threads?id=karmakaze&next=33505...