That seems like more of an issue with tuples than with expressive if/else. Tuples are known for having this easy-to-miss disconnection (take for example a function call that returns a tuple, which couldn't be avoided like the above situation can)
let { value, weight } =
if values.empty() {
{ value: 0, weight: 1.0 }
} else {
{ value: values[0], weight: 1 / values.len() }
}
Using JS style object expansion, instead of tuple expansion.