Skip to content

Commit 317228f

Browse files
committed
Fix refcounted definition
1 parent 587cfa7 commit 317228f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mypyc/ir/rtypes.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ class RTuple(RType):
646646
def __init__(self, types: list[RType]) -> None:
647647
self.name = "tuple"
648648
self.types = tuple(types)
649-
self.is_refcounted = any(t.is_refcounted for t in self.types)
649+
self._is_refcounted = any(t.is_refcounted for t in self.types)
650650
# Generate a unique id which is used in naming corresponding C identifiers.
651651
# This is necessary since C does not have anonymous structural type equivalence
652652
# in the same way python can just assign a Tuple[int, bool] to a Tuple[int, bool].
@@ -656,6 +656,10 @@ def __init__(self, types: list[RType]) -> None:
656656
self._ctype = f"{self.struct_name}"
657657
self.error_overlap = all(t.error_overlap for t in self.types) and bool(self.types)
658658

659+
@property
660+
def is_refcounted(self) -> bool:
661+
return self._is_refcounted
662+
659663
def accept(self, visitor: RTypeVisitor[T]) -> T:
660664
return visitor.visit_rtuple(self)
661665

0 commit comments

Comments
 (0)