Skip to content

Commit 5b81f85

Browse files
Update mapper.py
1 parent 8f926f4 commit 5b81f85

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mypyc/irbuild/mapper.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ def type_to_rtype(self, typ: Type | None) -> RType:
7373

7474
typ = get_proper_type(typ)
7575
if isinstance(typ, Instance):
76-
if typ.type.is_newtype:
76+
if typ.type.is_newtype and len(typ.type.bases) == 1:
77+
# I'm pretty sure this length check always returns True but am not positive and False would break things
7778
# Unwrap NewType to its base type for rprimitive mapping
7879
base_typeinfo = typ.type.bases[0].type
7980
return self.type_to_rtype(Instance(base_typeinfo, []))

0 commit comments

Comments
 (0)