Skip to content

Commit d670522

Browse files
Update ops.py
1 parent b231fb7 commit d670522

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mypyc/ir/ops.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,15 +1045,15 @@ class TupleGet(RegisterOp):
10451045

10461046
def __init__(self, src: Value, index: int, line: int = -1, *, borrow: bool = False) -> None:
10471047
super().__init__(line)
1048-
self.src = src
1049-
self.index = index
10501048
assert isinstance(
10511049
src.type, RTuple
10521050
), "TupleGet only operates on tuples, not {type(src.type).__name__}"
10531051
src_len = len(src.type.types)
10541052
if index < 0:
10551053
index += src_len
10561054
assert index <= src_len - 1, f"Index out of range.\nsource type: {src.type}\nindex: {index}"
1055+
self.src = src
1056+
self.index = index
10571057
self.type = src.type.types[index]
10581058
self.is_borrowed = borrow
10591059

0 commit comments

Comments
 (0)