ReSharper 1.5 and Unsafe

Hi. ReSharper 1.5 doesn't handle unsafe code well; that is, it erroneously marks usage of foo->bar as an error, saying "Method, delegate or event is expected".

Is this being corrected in 2.0?

2 comments
Comment actions Permalink

Could you post an example so that we are able to ensure that your particular
case works correctly now?

Hi. ReSharper 1.5 doesn't handle unsafe code well; that is, it
erroneously marks usage of foo->bar as an error, saying "Method,
delegate or event is expected".

Is this being corrected in 2.0?

Thanks,
Andrey Simanovsky


0
Comment actions Permalink

Could you post an example so that we are able to
ensure that your particular
case works correctly now?


In the following code excerpt, the line m_data->IncWarningCount() is flagged by ReSharper 1.5 build 165 as an error, saying ""Method, delegate or event is expected". However, the code compiles and runs without problems.

public unsafe class CompanyStatistics
{
private CompanyStatisticsData* m_data;
public CompanyStatistics(uint addr)
{
m_data = (CompanyStatisticsData*) addr;
}
public void IncWarningCount()
{
if (m_data != null)
m_data->IncWarningCount();
}
...
}


public unsafe struct CompanyStatisticsData
{
public int m_id;
public int m_warningCount;
...
}

0

Please sign in to leave a comment.