22// The .NET Foundation licenses this file to you under the Apache 2.0 License.
33// See the LICENSE file in the project root for more information.
44
5- using MSAst = System . Linq . Expressions ;
5+ #nullable enable
66
77using System ;
8- using IronPython . Runtime . Binding ;
98using Microsoft . Scripting . Actions ;
109using Microsoft . Scripting . Utils ;
11- using AstUtils = Microsoft . Scripting . Ast . Utils ;
1210
1311namespace IronPython . Compiler . Ast {
14- using Ast = MSAst . Expression ;
12+ using Ast = System . Linq . Expressions . Expression ;
13+ using AstUtils = Microsoft . Scripting . Ast . Utils ;
1514
1615 public class AndExpression : Expression {
1716 public AndExpression ( Expression left , Expression right ) {
@@ -28,15 +27,15 @@ public AndExpression(Expression left, Expression right) {
2827
2928 public Expression Right { get ; }
3029
31- public override MSAst . Expression Reduce ( ) {
32- MSAst . Expression left = Left ;
33- MSAst . Expression right = Right ;
30+ public override Ast Reduce ( ) {
31+ var left = Left ;
32+ var right = Right ;
3433
3534 Type t = Type ;
36- MSAst . ParameterExpression tmp = Ast . Variable ( t , "__all__" ) ;
35+ var tmp = Variable ( t , "__all__" ) ;
3736
3837 return Block (
39- new [ ] { tmp } ,
38+ new [ ] { tmp } ,
4039 Condition (
4140 GlobalParent . Convert (
4241 typeof ( bool ) ,
@@ -60,7 +59,8 @@ public override MSAst.Expression Reduce() {
6059
6160 public override Type Type {
6261 get {
63- return Left . Type == Right . Type ? Left . Type : typeof ( object ) ;
62+ Type leftType = Left . Type ;
63+ return leftType == Right . Type ? leftType : typeof ( object ) ;
6464 }
6565 }
6666
@@ -72,10 +72,6 @@ public override void Walk(PythonWalker walker) {
7272 walker . PostWalk ( this ) ;
7373 }
7474
75- internal override bool CanThrow {
76- get {
77- return Left . CanThrow || Right . CanThrow ;
78- }
79- }
75+ internal override bool CanThrow => Left . CanThrow || Right . CanThrow ;
8076 }
8177}
0 commit comments