From 8477d3188208fed68aab9bde2aae8d5674ee227c Mon Sep 17 00:00:00 2001 From: tserg <8017125+tserg@users.noreply.github.com> Date: Mon, 25 Sep 2023 17:40:54 +0800 Subject: [PATCH] fix derive helper --- vyper/semantics/types/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vyper/semantics/types/utils.py b/vyper/semantics/types/utils.py index 61faa8495e..50132b351d 100644 --- a/vyper/semantics/types/utils.py +++ b/vyper/semantics/types/utils.py @@ -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)