Skip to content

Commit 4ad507a

Browse files
Update constant_fold.py
1 parent 51fdd2d commit 4ad507a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mypyc/irbuild/constant_fold.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
ComplexExpr,
1919
Expression,
2020
FloatExpr,
21+
IndexExpr,
2122
IntExpr,
2223
MemberExpr,
2324
NameExpr,
@@ -72,7 +73,7 @@ def constant_fold_expr(builder: IRBuilder, expr: Expression) -> ConstantValue |
7273
value = constant_fold_expr(builder, expr.expr)
7374
if value is not None and not isinstance(value, bytes):
7475
return constant_fold_unary_op(expr.op, value)
75-
elif isinstance(expr, IndexOp):
76+
elif isinstance(expr, IndexExpr):
7677
base = constant_fold_expr(builder, expr.base)
7778
if base is not None:
7879
index = constant_fold_expr(builder, expr.base)

0 commit comments

Comments
 (0)