Bug: Invalid warning on IClonable (redundant cast)

When using an expression like

(OleDbConnection) ((ICloneable) connection).Clone (), ReSharper issues a
warning saying "Type cast is redundant", marking IClonable as the redundant
cast.

This is not the case however, since Clone is a private implementation that
is only accessible when the object is casted to an IClonable.

Regards,

/Staffan


1 comment
Comment actions Permalink

This should be a bug. Could you please post it into the tracker?

--
Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

"Staffan Gustafsson" <staffang_no_spam@home.se> wrote in message
news:caamo1$edr$1@is.intellij.net...

When using an expression like

>

(OleDbConnection) ((ICloneable) connection).Clone (), ReSharper issues a
warning saying "Type cast is redundant", marking IClonable as the

redundant

cast.

>

This is not the case however, since Clone is a private implementation that
is only accessible when the object is casted to an IClonable.

>

Regards,

>

/Staffan

>
>


0

Please sign in to leave a comment.