Skip to content

Commit 7fa55a8

Browse files
author
Alexander Bothe
committed
[Evaluation] Don't let static if()s pass through successfully by default if the tested expression could not be evaluated.
1 parent e2d5c64 commit 7fa55a8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

DParser2/Resolver/ConditionalCompilationFlags.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ public bool IsMatching(StaticIfCondition sc, ResolutionContext ctxt)
112112
}
113113
catch
114114
{
115-
return true; //TODO: Remove the try / Notify the user on an exception case -- when the evaluation is considered stable only!!
115+
return false; //TODO: Remove the try / Notify the user on an exception case -- when the evaluation is considered stable only!!
116116
}
117-
return v == null || !Evaluation.IsFalseZeroOrNull(v); //TODO: Just because the expression evaluation isn't working properly currently, let it return true to have it e.g. in the completion list
117+
return !Evaluation.IsFalseZeroOrNull(v); //TODO: Just because the expression evaluation isn't working properly currently, let it return true to have it e.g. in the completion list
118118
}
119119
}
120120

0 commit comments

Comments
 (0)