@@ -76,7 +76,7 @@ public override Expression Visit(Expression expression)
7676 protected override Expression VisitBinary ( BinaryExpression node )
7777 {
7878 var leftExpression = node . Left ;
79- var rightExpression = node . Right ;
79+ var rightExpression = node . Right ;
8080
8181 if ( leftExpression . Type == typeof ( bool ) && rightExpression . Type == typeof ( bool ) )
8282 {
@@ -138,7 +138,7 @@ protected override Expression VisitConditional(ConditionalExpression node)
138138 }
139139
140140 var ifTrue = Visit ( node . IfTrue ) ;
141- var ifFalse = Visit ( node . IfFalse ) ;
141+ var ifFalse = Visit ( node . IfFalse ) ;
142142
143143 if ( BothAreConstant < bool > ( ifTrue , ifFalse , out var ifTrueValue , out var ifFalseValue ) )
144144 {
@@ -155,16 +155,16 @@ protected override Expression VisitConditional(ConditionalExpression node)
155155 // T ? true : Q => T || Q
156156 // T ? false : Q => !T && Q
157157 return ifTrueValue
158- ? Visit ( Expression . Or ( test , ifFalse ) )
159- : Visit ( Expression . And ( Expression . Not ( test ) , ifFalse ) ) ;
158+ ? Visit ( Expression . OrElse ( test , ifFalse ) )
159+ : Visit ( Expression . AndAlso ( Expression . Not ( test ) , ifFalse ) ) ;
160160 }
161161 else if ( IsConstant < bool > ( ifFalse , out ifFalseValue ) )
162162 {
163163 // T ? P : true => !T || P
164164 // T ? P : false => T && P
165165 return ifFalseValue
166- ? Visit ( Expression . Or ( Expression . Not ( test ) , ifTrue ) )
167- : Visit ( Expression . And ( test , ifTrue ) ) ;
166+ ? Visit ( Expression . OrElse ( Expression . Not ( test ) , ifTrue ) )
167+ : Visit ( Expression . AndAlso ( test , ifTrue ) ) ;
168168 }
169169
170170 return node . Update ( test , ifTrue , ifFalse ) ;
0 commit comments