Skip to content

Commit

Permalink
fix derive helper
Browse files Browse the repository at this point in the history
  • Loading branch information
tserg committed Sep 25, 2023
1 parent d4e8b0d commit 8477d31
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vyper/semantics/types/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,14 @@ def derive_folded_value(node: vy_ast.VyperNode):
return None
return node.op._op(values)
elif isinstance(node, vy_ast.Call):
if len(node.args) == 1 and isinstance(node.args[0], Dict):
# constant structs
if len(node.args) == 1 and isinstance(node.args[0], vy_ast.Dict):
return derive_folded_value(node.args[0])

from vyper.semantics.analysis.utils import get_exact_type_from_node

call_type = get_exact_type_from_node(node.func)
# builtins
if hasattr(call_type, "evaluate"):
try:
evaluated = call_type.evaluate(node)
Expand Down

0 comments on commit 8477d31

Please sign in to comment.