diff options
author | Dan Scales <danscales@google.com> | 2021-05-14 16:35:04 -0700 |
---|---|---|
committer | Dan Scales <danscales@google.com> | 2021-05-24 22:17:33 +0000 |
commit | d48f6d9f6f1ee7099ad129552507903e191ad589 (patch) | |
tree | 261a885d30efe6bafe1b6150fab107cd8aecb35c /test/typeparam/mapsimp.go | |
parent | 4c50721cda74abbf7732638f39a23dfbf6271a48 (diff) | |
download | go-d48f6d9f6f1ee7099ad129552507903e191ad589.tar.gz go-d48f6d9f6f1ee7099ad129552507903e191ad589.zip |
[dev.typeparams] Don't check typecheck(3) on transform, so no need to export/import it
We have a value typecheck(3) that indicates that a node in a generic
function still needs transformation (via the functions in transform.go).
But it is not very desirable to export/import the value of typecheck(3).
So, I changed the stenciling code to just try to transform all relevant
node types during node copy. Almost all tranform functions were already
idempotent. I only had to add an extra if check before calling
transformAssign() in the OAS case. We still use the typecheck(3) in
noder to determine when higher-nodes have to delay transformation
because one or more of their args are delaying transformation.
Added new test mapsimp.go that required these tranformations after import.
As an additional change, export/import of OINDEX requires exporting the
type using w.exoticType() rather than w.typ(), in order to handle
generic functions. Since generic functions can have pre-transform
operations, the index operation can have a tuple type (multiple return
from a map lookup).
Added printing of imported function bodies in -W=3 debug mode.
Change-Id: I220e2428dc5f2741e91db146f075eb5b6045f451
Reviewed-on: https://go-review.googlesource.com/c/go/+/322191
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Dan Scales <danscales@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'test/typeparam/mapsimp.go')
-rw-r--r-- | test/typeparam/mapsimp.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/typeparam/mapsimp.go b/test/typeparam/mapsimp.go new file mode 100644 index 0000000000..76930e5e4f --- /dev/null +++ b/test/typeparam/mapsimp.go @@ -0,0 +1,7 @@ +// rundir -G=3 + +// Copyright 2021 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package ignored |