2 comments
Comment actions Permalink

Thank you for the report.
This issue will be fixed in the next version

--
Eugene Pasynkov
Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Richard" <monica.spence@t4g.com> wrote in message
news:efu2cn$vub$1@is.intellij.net...

Hi,

>

Given the following code, ReSharper reports that the cast to string is
redundant:

>

private IEnumerator<string> GetNameEnumerator(DataTable names)
{
foreach (DataRow r in names.Rows)
{
yield return (string) r["Name"];
}
}

>

Without the cast, compiling fails with the error "Cannot implicitly
convert type 'object' to 'string'...".

>

Thanks.

>

---
Richard



0
Comment actions Permalink

Eugene,

I get a similar thing with delegates - it tells me the cast is invalid, but
fails to compile if I remove it.

Dino

DataAccess.BaseClassData baseClassData =
PerformDBFunction((Delegates.BaseClassDataGuidDelegate) this.DataClass.Load,
uniqueID);

"Eugene Pasynkov (JetBrains)" <Eugene.Pasynkov@jetbrains.com> wrote in
message news:efu6e9$k29$1@is.intellij.net...

Thank you for the report.
This issue will be fixed in the next version

>

--
Eugene Pasynkov
Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Richard" <monica.spence@t4g.com> wrote in message
news:efu2cn$vub$1@is.intellij.net...

>> Hi,
>>
>> Given the following code, ReSharper reports that the cast to string is
>> redundant:
>>
>> private IEnumerator



0

Please sign in to leave a comment.