Skip to content

Commit 4e1596c

Browse files
use cast
1 parent c29d5cd commit 4e1596c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mypyc/irbuild/specialize.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from __future__ import annotations
1616

17-
from typing import Callable, Final, Optional
17+
from typing import Callable, Final, Optional, cast
1818

1919
from mypy.nodes import (
2020
ARG_NAMED,
@@ -40,6 +40,7 @@
4040
Call,
4141
Extend,
4242
Integer,
43+
PrimitiveDescription,
4344
RaiseStandardError,
4445
Register,
4546
Truncate,
@@ -641,7 +642,7 @@ def translate_isinstance(builder: IRBuilder, expr: CallExpr, callee: RefExpr) ->
641642
is_last = i == len(descs) - 1
642643
next_block = fail_block if is_last else BasicBlock()
643644
builder.add_bool_branch(
644-
builder.primitive_op(desc, [obj], expr.line), pass_block, next_block # type: ignore [arg-type]
645+
builder.primitive_op(cast(PrimitiveDescription, desc), [obj], expr.line), pass_block, next_block
645646
)
646647
if not is_last:
647648
builder.activate_block(next_block)

0 commit comments

Comments
 (0)