I think there’s still a miscommunication here.
Let me ask a question, starting with a modified version of @tbu’s example:
fn main() {
let bar = true;
let baz = true;
let foo = if bar == baz {
(0..10).map(|_| 1).collect() // line 5
} else {
println!("Else statement!");
let v : Vec<f32> = [...]; // line 8
[...]
v
};
println!("Foo: {:?}", foo);
}
Does this count as “completely unambiguous”? To the compiler, its clearly unambiguous: foo is definitely a Vec<f32>, so on line 5, we must be talking about f32s.
It sounds to me like you’re saying that that doesn’t count as “completely unambiguous”, that the only thing that counts as “completely unambiguous” is to have the type hint on the same line. However, I don’t think there are any places in the compiler that treat “on the same line” as any more or less ambiguous than the example above; are you suggesting that we special-case this, just for float literals?