CodeConverter
CodeConverter copied to clipboard
VB -> C#: wrong conversion of CDate(Nothing)
Input code
Assert.That(CDate(Nothing) = New Date(1, 1, 1))
Erroneous output
Assert.That(Conversions.ToDate(default) == new DateTime(1, 1, 1));
throws System.InvalidCastException
Expected output
Assert.That(default(DateTime) == new DateTime(1, 1, 1));
Details
- Product in use: VS extension
- Version in use: 8.2.0.0
- Did you see it working in a previous version, which? No
Thanks. I'll expect there's a whole class of related bugs since date and DateTime have some differences. E.g. If code calls another vb library that returns a date, it needs to be converted to date time in some way. Same for parameters passed.