Skip to content

Commit 0604390

Browse files
committed
Update ircheck.py
1 parent 0a376c6 commit 0604390

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mypyc/analysis/ircheck.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,10 @@ def can_coerce_to(src: RType, dest: RType) -> bool:
199199
if isinstance(src, RPrimitive):
200200
# If either src or dest is a disjoint type, then they must both be.
201201
if src.name in disjoint_types and dest.name in disjoint_types:
202-
return src.name == dest.name
202+
return src.name == dest.name or (
203+
src.name in ("builtins.dict", "builtins.dict[exact]")
204+
and dest.name in ("builtins.dict", "builtins.dict[exact]")
205+
)
203206
return src.size == dest.size
204207
if isinstance(src, RInstance):
205208
return is_object_rprimitive(dest)

0 commit comments

Comments
 (0)