Skip to content

Commit 1f3d146

Browse files
Update mapper.py
1 parent 47ab0d4 commit 1f3d146

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mypyc/irbuild/mapper.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
str_rprimitive,
4747
tuple_rprimitive,
4848
uint8_rprimitive,
49+
weakref_rprimitive,
4950
)
5051

5152

@@ -102,6 +103,8 @@ def type_to_rtype(self, typ: Type | None) -> RType:
102103
return tuple_rprimitive # Varying-length tuple
103104
elif typ.type.fullname == "builtins.range":
104105
return range_rprimitive
106+
elif typ.type.fullname == "weakref.ReferenceType":
107+
return weakref_rprimitive
105108
elif typ.type in self.type_to_ir:
106109
inst = RInstance(self.type_to_ir[typ.type])
107110
# Treat protocols as Union[protocol, object], so that we can do fast

0 commit comments

Comments
 (0)