Skip to content

Commit 8ebc37c

Browse files
committed
C#: Address copilots review comments.
1 parent 9bf56c5 commit 8ebc37c

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

‎csharp/ql/src/Language Abuse/SimplifyBoolExpr.ql‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ predicate rewriteBinaryExpr(BinaryOperation op, boolean value, string oldPattern
7171
}
7272

7373
predicate rewriteConditionalExpr(ConditionalExpr cond, string oldPattern, string newPattern) {
74+
cond.getCondition().getType() instanceof BoolType and
7475
cond.getThen().getType() instanceof BoolType and
7576
cond.getElse().getType() instanceof BoolType and
7677
(

‎csharp/ql/test/query-tests/Language Abuse/SimplifyBoolExpr/SimplifyBoolExpr.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ void Fn()
4646
if (true || false) ;
4747

4848
bool? boption = false;
49-
if (boption == true) ; // GOOD. Cant be simplified like a regular bool
49+
if (boption == true) ; // GOOD. Can't be simplified like a regular bool
5050
}
5151
}

0 commit comments

Comments
 (0)