Open
Description
Just ran into this today, apparently it's a long standing bug: dotnet/roslyn#2780, although I disagree with the recommended behavior.
IMO the correct fix is for the call to Conversions::ToDate(string) to check to see if the string is null, and return DateTime.MinValue if so.
In my case, Option Strict was Off and the actual assignment that caused the problem was obj.d = if(function(a, b)) where sometimes the return value was nothing and sometimes it was a string that could be interpreted as a date. Obviously the better code would be DateTime.TryParse(function(a,b), obj.d), but it shouldn't break.
Metadata
Metadata
Assignees
Labels
No labels