From 58f25b6d6cb4b25e9f505f437559eb1844e522f9 Mon Sep 17 00:00:00 2001 From: Charles Cooper Date: Sun, 31 Dec 2023 11:06:35 -0500 Subject: [PATCH] add back in deepcopy of vyper_module so that you can always recover the unannotated AST even if later phases get run. --- vyper/compiler/phases.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vyper/compiler/phases.py b/vyper/compiler/phases.py index fbb57c08d7..45cab440b8 100644 --- a/vyper/compiler/phases.py +++ b/vyper/compiler/phases.py @@ -2,6 +2,7 @@ from functools import cached_property from pathlib import Path, PurePath from typing import Optional +import copy from vyper import ast as vy_ast from vyper.codegen import module @@ -259,6 +260,7 @@ def generate_annotated_ast( StorageLayout Layout of variables in storage """ + vyper_module = copy.deepcopy(vyper_module) with input_bundle.search_path(Path(vyper_module.resolved_path).parent): # note: validate_semantics does type inference on the AST validate_semantics(vyper_module, input_bundle)