RS incorrectly flagging comparison of enums as invalid

The message (see screen shot) shows that the operands are the same type, and yet says that they can't be compared.  What's up with that?

noError_error.png

0
3 comments

Hi, would you mind posting this on our bug tracker, preferably attaching source code so we can take a look?

Thanks,
Dmitri

0

I'll post there asap.  Meanwhile, since the message isn't readable in the uploaded image, I'll explain here that it says "cannot apply operator '!=' to operands of type {this} and {that}" where  this and that are the same type. And, of course, the code compiles and runs properly.

0

I may have the answer on this.  The project where the problem occurs refers to the assembly that defines the enumerated type.  (assembly reference not project reference).  However, there are other projects in the solution that refer to the project that defines the enumerated type. WHile there are valid reasons for this configuration,   I could imagine that resharper might have some confusion over that.

0

Please sign in to leave a comment.