From ba58735dbd0ca9b2fe22663557b062236cd9542b Mon Sep 17 00:00:00 2001 From: Tristan Swadell Date: Wed, 24 Jan 2024 16:29:44 -0800 Subject: [PATCH] Revert the AST copy as some users were relying on Check to be mutable (#890) --- checker/checker.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/checker/checker.go b/checker/checker.go index 8870739e..57fb3ce5 100644 --- a/checker/checker.go +++ b/checker/checker.go @@ -48,9 +48,10 @@ type checker struct { // registry. func Check(parsed *ast.AST, source common.Source, env *Env) (*ast.AST, *common.Errors) { errs := common.NewErrors(source) - checked := ast.Copy(parsed) + typeMap := make(map[int64]*types.Type) + refMap := make(map[int64]*ast.ReferenceInfo) c := checker{ - AST: checked, + AST: ast.NewCheckedAST(parsed, typeMap, refMap), ExprFactory: ast.NewExprFactory(), env: env, errors: &typeErrors{errs: errs},