Reputation: 18670
Implicit conversions when using DateTime/DateTimeOffset, or int/decimal variables can cause unexpected behaviors at runtime, so I would prefer to raise warning or errors at compile time when such a conversion is detected.
How can I achieve that in Visual Studio 2010?
Upvotes: 0
Views: 1700
Reputation: 5836
It is not possible to disable implicit conversions in C#.
However, Visual Basic can disable them using Option Strict On
.
Upvotes: 3