Vannevelj / VSDiagnostics

A collection of static analyzers based on Roslyn that integrate with VS
GNU General Public License v2.0
65 stars 16 forks source link

bool? == true can't be simplified #612

Closed Vannevelj closed 7 years ago

Vannevelj commented 8 years ago

Verify that the == true simplifier doesn't fire for nullable bools.

Hosch250 commented 7 years ago

We already have tests for this: https://github.com/VSDiagnostics/VSDiagnostics/blob/develop/VSDiagnostics/VSDiagnostics/VSDiagnostics.Test/Tests/General/CompareBooleanToTrueLiteralTests.cs#L595

https://github.com/VSDiagnostics/VSDiagnostics/blob/develop/VSDiagnostics/VSDiagnostics/VSDiagnostics.Test/Tests/General/CompareBooleanToFalseLiteralTests.cs#L506

Hosch250 commented 7 years ago

We should make an issue for merging these two analyzers, however.

Vannevelj commented 7 years ago

Perhaps they should've been but it's not an important enough issue to change now