Skip to content

Commit b025bda

Browse files
authored
Remove last unreachable block from mypyc code (#19086)
Supplements #19050. The old version did certainly contain unreachable code, as otherwise that branch would have crashed, there is no `type_args` attribute. This block was introduced in #17027 - probably as a future-proof expansion to generic primitive operations, but it makes no sense now, this logic can be added back should it become necessary.
1 parent ce6355e commit b025bda

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

mypyc/ir/pprint.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -220,19 +220,7 @@ def visit_call_c(self, op: CallC) -> str:
220220
return self.format("%r = %s(%s)", op, op.function_name, args_str)
221221

222222
def visit_primitive_op(self, op: PrimitiveOp) -> str:
223-
args = []
224-
arg_index = 0
225-
type_arg_index = 0
226-
for arg_type in zip(op.desc.arg_types):
227-
if arg_type:
228-
args.append(self.format("%r", op.args[arg_index]))
229-
arg_index += 1
230-
else:
231-
assert op.type_args
232-
args.append(self.format("%r", op.type_args[type_arg_index]))
233-
type_arg_index += 1
234-
235-
args_str = ", ".join(args)
223+
args_str = ", ".join(self.format("%r", arg) for arg in op.args)
236224
if op.is_void:
237225
return self.format("%s %s", op.desc.name, args_str)
238226
else:

0 commit comments

Comments
 (0)