Skip to content

Commit 8c6be05

Browse files
Update builder.py
1 parent 1806d85 commit 8c6be05

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

mypyc/irbuild/builder.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ def load_type_var(self, name: str, line: int) -> Value:
601601
)
602602
)
603603

604-
def load_literal_value(self, val: int | str | bytes | float | complex | bool) -> Value:
604+
def load_literal_value(self, val: int | str | bytes | float | complex | bool | tuple[Any, ...], dict[Any, Any]) -> Value:
605605
"""Load value of a final name, class-level attribute, or constant folded expression."""
606606
if isinstance(val, bool):
607607
if val:
@@ -618,6 +618,12 @@ def load_literal_value(self, val: int | str | bytes | float | complex | bool) ->
618618
return self.builder.load_bytes(val)
619619
elif isinstance(val, complex):
620620
return self.builder.load_complex(val)
621+
elif isinstance(val, tuple):
622+
# TODO: validate this code path
623+
return self.builder.load_tuple(val)
624+
elif isinstance(val, dict):
625+
# TODO: validate this code path
626+
return self.builder.load_dict(val)
621627
else:
622628
assert False, "Unsupported literal value"
623629

0 commit comments

Comments
 (0)