Skip to content

Commit fba7466

Browse files
Update ircheck.py
1 parent be813b2 commit fba7466

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
@@ -198,7 +198,10 @@ def can_coerce_to(src: RType, dest: RType) -> bool:
198198
if isinstance(src, RPrimitive):
199199
# If either src or dest is a disjoint type, then they must both be.
200200
if src.name in disjoint_types and dest.name in disjoint_types:
201-
return src.name == dest.name
201+
return src.name == dest.name or (
202+
src.name in ("builtins.dict", "builtins.dict[exact]")
203+
and dest.name in ("builtins.dict", "builtins.dict[exact]")
204+
)
202205
return src.size == dest.size
203206
if isinstance(src, RInstance):
204207
return is_object_rprimitive(dest)

0 commit comments

Comments
 (0)