News for hackers. Stuff that matters.
Re:What's new in the .NET 11 runtime by FearNotDaniel on Tuesday November 10, 2026 @03:01PM (#50445521)
Exactly. If you want an actual decimal literal you should always write it as 1.2345m rather than converting it with the (decimal) prefix. The compiler refuses to accept a plain 1.2345 assigned to a decimal type so it’s not such a footgun as it may appear to some; though it might offer a better DX if the type of the literal was inferred from the thing you are trying to assign it to, that would no doubt have unintended consequences.

There are no comments on this comment yet.