Bug with DateTime null usages with Script#?

Hi,

When working with a project using Script#, I'm finding that Resharper gets confused when dealing with DateTime objects -- which happen to be classes in the Script# core libraries (aacorlib and sscorlib) as compared to mscorlib, where they're a struct. Specifically, it'll complain if you assing null to a DateTime (cannot convert source null to target type System.DateTime) or compare a DateTime to null (cannot apply operator == to operands of type System.DateTime and null).

My suspicion is that Resharper has a hardcoded list of structs somewhere and that DateTime is one of them. However, this clearly isn't the case if you're not using the standard core libraries.

Has anyone else noticed this, or could someone take a look?

Donovan

1 comment
Comment actions Permalink

Hello Donovan,

This can happen if you have both standard and non-standard mscorlib in the
same solution. This problem is solved in ReSharper 4.

Sincerely,
Ilya Ryzhenkov

JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


IR> Hi,
IR>
IR> When working with a project using Script#, I'm finding that
IR> Resharper gets confused when dealing with DateTime objects -- which
IR> happen to be classes in the Script# core libraries (aacorlib and
IR> sscorlib) as compared to mscorlib, where they're a struct.
IR> Specifically, it'll complain if you assing null to a DateTime
IR> (cannot convert source null to target type System.DateTime) or
IR> compare a DateTime to null (cannot apply operator == to operands of
IR> type System.DateTime and null).
IR>
IR> My suspicion is that Resharper has a hardcoded list of structs
IR> somewhere and that DateTime is one of them. However, this clearly
IR> isn't the case if you're not using the standard core libraries.
IR>
IR> Has anyone else noticed this, or could someone take a look?
IR>
IR> Donovan
IR>


0

Please sign in to leave a comment.