Skip to content

IDE0074 should not fire for cases where pattern can only be simplified when "preprocessor constant" defined #63552

@jkoritzinsky

Description

@jkoritzinsky

Version Used: 4.4.0-1.final

Steps to Reproduce:

https://sharplab.io/#v2:CYLg1APgAgTAjAWAFBQMwAICuA7AzgQwDMBTdWdAYXQG9l1706GAHAJwEsA3fAF1KjgA2MnBjoA4sR5QArAAoAlOgC8APnQ8AFqwD2Ad3TZMAG2MBuJvUvo2XXv1HpcAfUI4AxhaQNG3hmhExAFlFGmsfATE3bHcVJ1cPLx8fdkJ0OWjY5WVDE2MFcIZaJABiVPQADULkkQBOOQAiTPR2XFzTBoUvEuJsYFTq5Oacl2GJKVlFJJr0AF9BqAB2dEzp+nmkWaA

Real life example at https://github.com/dotnet/runtime/pull/74445/files/82265a6e849b44cb5bea33ec5fe70378a332aeff#diff-f57a5ba97726bf6cbcac6f3805a79a0a64d1f35ad9d9dac7d686b911441d90ca

Expected Behavior:

No IDE0074 diagnostic when the preprocessor directive is not defined.

Actual Behavior:

IDE0074 diagnostic reported when preprocessor directive is not defined. IDE0074 diagnostic not reported when preprocessor directive is defined.

Metadata

Metadata

Labels

Area-IDEuntriagedIssues and PRs which have not yet been triaged by a lead

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions