Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversion of Nothing literal to Date? as operand of ternary If expression incorrectly reported as unnecessary #5685

Closed
AnthonyDGreen opened this issue Oct 5, 2015 · 0 comments
Assignees
Labels
Area-IDE Bug Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented Verified
Milestone

Comments

@AnthonyDGreen
Copy link
Contributor

Module Module1
    Sub Main()
        Dim d As Date? = If(True, DirectCast(Nothing, Date?), CDate(""))
    End Sub
End Module

The DirectCast above is faded. This also affects CType. Removing the conversion would cause the Nothing literal to be interpreted as #1/1/0001 00:00:00# rather than as a null nullable Date.

@Pilchie Pilchie added the Bug label Oct 5, 2015
@Pilchie Pilchie added this to the 1.1 milestone Oct 5, 2015
@DustinCampbell DustinCampbell added the Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented label Oct 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Bug Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented Verified
Projects
None yet
Development

No branches or pull requests

4 participants