"Qualifier is redundant" False Positive

In the VB.NET code below, A.B. is reported as a redundant qualifier, when it clearly is not.
-TC

Class A
  Public Shared B As Object
End Class

Class B
End Class

Public Class C
  Dim D As Object = A.B.ToString
End Class

0
4 comments

A follow-up:

The consequences of this bug are significant.

Essentially, if you have a shared member that shares a name with a class, you are likely to get inappropriate "Qualifier is redundant" warnings. Several dozen appear in my code, and they are frustrating because they prevent me from clearing away all Resharper warnings.

For instance, I'm currently getting the warning because I have a class which exposes a shared property called "DataSet", and I'm using that class in a file which imports System.Data, which has a "DataSet" class. When I refer to the property, I often get an invalid "Qualifier is redundant" warning.

The obvious workaround is to rename things until the error goes away. I consider this to be an unsatisfactory solution because in some situations it prevents me from using the best and most obvious name for a member or a class.

I would be grateful if someone at JetBrains would attend to this and let me know if a fix is in the pipeline.

-TC

0
Avatar
Klaus Luedenscheidt

i think you should generally avoid to use variable or property names are equal to class names. This always leads to confusion.

Regards
Klaus

0

Perhaps, but that is beside the point. Resharper reports "Qualifier is redundant" when there is no redundant qualifier.
-TC

0

Sorry to revive a ghost, but I am also getting false positives, and this doesn't seem to be resolved. In this case, I've linked to somebody else's code, so it is not quite as easy for me to give a minimal example which I can be confident is the same, but here are the short details:

 

It is in VB (not my choice!)

If I call A = B.Create(param) I am told 'Qualifier is redundant' with respect to B. It isn't, because if I remove B, as occurs on an automatic code cleanup, I am then told 'Create' is ambiguous.

Create is a function with overloads. B is a module in a namespace which is imported.

 

0

Please sign in to leave a comment.