dotnet/msbuild

Remove conditional-evaluation-order warning

Open

#1 698 ouverte le 14 févr. 2017

Voir sur GitHub
 (10 commentaires) (6 réactions) (0 assignés)C# (1 364 forks)batch import
Area: Languagehelp wantedtriaged

Métriques du dépôt

Stars
 (5 062 stars)
Métriques de merge PR
 (Merge moyen 11j 7h) (125 PRs mergées en 30 j)

Description

The warning

MSB4130: The condition "{0}" may have been evaluated incorrectly in an earlier version of MSBuild. Please verify that the order of the AND and OR clauses is written as intended. To avoid this warning, add parentheses to make the evaluation order explicit.

is emitted whenever a condition has an and and an or in parallel, for example X and Y or Z.

Looking through ancient history, it appears to have been introduced in MSBuild 3.5 in 2007, because a bug in MSBuild 2.0 that caused unexpected evaluation order was fixed then.

It feels wrong to emit an informational-only warning about a behavior change that happened 10 years ago.

Eliminating the check for this warning would allow pruning a tree of methods that exist only to provide it. They're currently in the code in REMOVE_COMPAT_WARNING regions. I propose to do just what that implies.

Guide contributeur