
Would be nice that C# compiler handled this case:
float f = 2.5;
I get the idea of protecting against precision loss. But why do you fail to compile for values that can be determined at compile time to not have precision loss?
It's no longer 2005, it's 2025 and changing this will only break the code that does not compile (like someones test suites might have such), which IMO is fine.