[312] Compact Framework projects - False Negatives

Hi,

All of the lines of code below marked with * give the following
resharper error/warning:

Cannot convert source type 'T' to target type 'Double'

The code compiles without issue.

internal SmartToolRawData(IList data, DateTime recorded) { int offSet = 0; StationDepth = (int)data[offSet++]; toolRecordNum = (int)data[offSet++]; gravX = data[offSet++]; * gravY = data[offSet++]; * gravZ = data[offSet++]; * magX = data[offSet++]; * magY = data[offSet++]; * magZ = data[offSet++]; * BatteryVoltage = data[offSet++]; * ToolTempCent = data[offSet]; * RecordTime = recorded; } ]]>

I get lots of these false negatives when generics are involved. It also
seems to be a problem that only effects Compact Framework projects.
Indeed, the code above is used in a desktop project and Resharper
doesn't report any issues with this code at all.

BTW, this isn't just a problem with 312 its been going on for ages, this
is the first piece of code I managed to find that is a succint example
of the problem.

Is there any chance that you could address quickly? The reason being
that I keep seeing these red markers in my source only to realise that
its a reshaper bug and not my code. So as you can imagine, its quite a
distraction. Thanks.

Regards
Barry Carr

5 comments
Comment actions Permalink

Hello Barry,

could you please tell us if you have ordinary (not Compact) .NET framework
projects in the solution
where you see this problem?


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


Hi,

All of the lines of code below marked with * give the following
resharper error/warning:

Cannot convert source type 'T' to target type 'Double'

The code compiles without issue.

<code>
internal SmartToolRawData(IList<double> data, DateTime recorded) {
int offSet = 0;
StationDepth = (int)data[offSet++];
toolRecordNum = (int)data[offSet++];
gravX = data[offSet++]; *
gravY = data[offSet++]; *
gravZ = data[offSet++]; *
magX = data[offSet++]; *
magY = data[offSet++]; *
magZ = data[offSet++]; *
BatteryVoltage = data[offSet++]; *
ToolTempCent = data[offSet]; *
RecordTime = recorded;
}
</code>
I get lots of these false negatives when generics are involved. It
also seems to be a problem that only effects Compact Framework
projects. Indeed, the code above is used in a desktop project and
Resharper doesn't report any issues with this code at all.

BTW, this isn't just a problem with 312 its been going on for ages,
this is the first piece of code I managed to find that is a succint
example of the problem.

Is there any chance that you could address quickly? The reason being
that I keep seeing these red markers in my source only to realise that
its a reshaper bug and not my code. So as you can imagine, its quite a
distraction. Thanks.

Regards
Barry Carr



0
Comment actions Permalink

Dmitry Shaporenkov wrote:

Hello Barry,

could you please tell us if you have ordinary (not Compact) .NET
framework projects in the solution
where you see this problem?

Hi Dimitry,

I've just been through all my projects that target the desktop. Not one
of them has this problem. Is there anything else you would like me to do?

Regards
Barry Carr

0
Comment actions Permalink

Hello Barry,

actually what I meant was if you have Desktop framework projects in the same
solution. Combining Desktop
and Compact projects in one solution may unfortunately cause the issue you've
described - ReSharper confuses two mscorlib assemblies, one from Compact
and Desktop and as a result treats e.g. 'Int32' from Compact framework and
from Desktop framework as different types.


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


Dmitry Shaporenkov wrote:

>> Hello Barry,
>>
>> could you please tell us if you have ordinary (not Compact) .NET
>> framework projects in the solution
>> where you see this problem?

Hi Dimitry,

I've just been through all my projects that target the desktop. Not
one of them has this problem. Is there anything else you would like me
to do?

Regards
Barry Carr



0
Comment actions Permalink

Dmitry Shaporenkov wrote:
> actually what I meant was if you have Desktop framework projects in the

same solution. Combining Desktop
and Compact projects in one solution may unfortunately cause the issue
you've described - ReSharper confuses two mscorlib assemblies, one from
Compact and Desktop and as a result treats e.g. 'Int32' from Compact
framework and from Desktop framework as different types.


Hi Dmity,

I see what you are saying. My main compact framework solution does
indeed have one desktop project in it. Its a project that provides an
extension to the installer, this must be what is causing the confusion.
Is there any work around, other than excluding the desktop project from
the solution?

Regards
Barry Carr

0
Comment actions Permalink

Hello Barry,

so does removal of the desktop project remedy the problem?

As for a workaround for the problem with two Mscorlibs, unfortunately I can't
immediately figure out one. This is a long-standing
issue, and it will likely be resolved in 3.0 version.

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


Dmitry Shaporenkov wrote:

>> actually what I meant was if you have Desktop framework projects in
>> the
>> same solution. Combining Desktop
>> and Compact projects in one solution may unfortunately cause the
>> issue
>> you've described - ReSharper confuses two mscorlib assemblies, one
>> from
>> Compact and Desktop and as a result treats e.g. 'Int32' from Compact
>> framework and from Desktop framework as different types.

Hi Dmity,

I see what you are saying. My main compact framework solution does
indeed have one desktop project in it. Its a project that provides an
extension to the installer, this must be what is causing the
confusion. Is there any work around, other than excluding the desktop
project from the solution?

Regards
Barry Carr



0

Please sign in to leave a comment.