SergeyTeplyakov / ErrorProne.NET

Set of roslyn-based analyzers for catching common C# errors (inspired by Google's error-prone)
MIT License
886 stars 42 forks source link

Fix IsStructLike to check for value types rather than reference types #264

Closed munik closed 9 months ago

munik commented 9 months ago

@SergeyTeplyakov I'm guessing this was a regression in c0aaebc0eca55d25038c307f2af2ff661e81ac5b.

In 0.3.0 and above I get EPS11 when there's a struct inside a class (which is not a problematic situation) but prior to 0.3.0 I do not.

I was not able to figure out how to build NuGet packages from your source, so I was unable to test this, but you'll know whether or not this is right or not 🙂

munik commented 9 months ago

I figured out how to run the unit tests, and this is the wrong fix. This is skipping reference types, which is what we want, but the reason I'm having an issue is that the latest published version is 0.4.0 and the skipping of reference types wasn't added until 0.5.0, which isn't published yet.

When do you think 0.5.0 will be a publishable beta?

munik commented 9 months ago

Note: The IsStructLike method should probably be renamed to IsRefLike unless I'm missing something.