dotnet-webassembly icon indicating copy to clipboard operation
dotnet-webassembly copied to clipboard

Fix Rider errors

Open GerardSmit opened this issue 3 years ago • 1 comments

This PR fixes a couple of Rider errors:

  1. Unreachable code detected (empty ; blocks) image
  2. Property is used instead of type in <see cref=""> If there is a property that has the same name of the type, the property is being used in <see cref="">. Because the enum instance doesn't have the property name (e.g. Block), it'll show an error. image
  3. Null-types doesn't match Because the dictionary already implements the interface, I simply removed it. image
  4. Usage of obsolete method In the helpers class an method is marked as obsolete because it only should be used internally. Because of this Rider complains the method shouldn't be used. I've added a #pragma warning disable in the file where this method is used. Maybe it's better to change the class to internal instead of public but this would cause an API change. image

GerardSmit avatar Dec 22 '22 12:12 GerardSmit

Unreachable code detected

I like this.

Property is used instead of type

Rider is wrong here. Both the dotnet compiler and Visual Studio correctly resolve the reference. The change you suggest actually makes Visual Studio show "WebAssembly" as greyed out due to not being necessary, making me not want to merge this commit. You should report this bug to JetBrains.

Null-types doesn't match

Neither the dotnet compiler nor Visual Studio share this complaint, but I agree that implementing this change is acceptable since the interface isn't needed.

Usage of obsolete method

Neither the dotnet compiler nor Visual Studio share this complaint. Apparently Rider and VS/dotnet command line have different opinions about whether nameof constitutes "usage" of obsolete code.

Disabling warnings on the entire file is too aggressive--it could cause new issues to be missed. I'd accept disabling the warning on the affected lines and then restoring the warning after.

RyanLamansky avatar Jan 02 '23 23:01 RyanLamansky