summaryrefslogtreecommitdiffhomepage
path: root/tools/go_generics
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-06-08 13:34:58 -0700
committergVisor bot <gvisor-bot@google.com>2020-06-08 13:34:58 -0700
commitac37979ca8c3b09d70a3c9e4048683a3af87d189 (patch)
treeab7f7a3833eb473108cca86a67c5992088f237c1 /tools/go_generics
parentdc029b4b96e92719b2850e9d5556f68837737997 (diff)
parent03cee0656c9fd8cf9509c3a91baf72db4a8f6d28 (diff)
Merge pull request #1875 from zhiqiangxu:fix_scope_add
PiperOrigin-RevId: 315341669
Diffstat (limited to 'tools/go_generics')
-rw-r--r--tools/go_generics/globals/scope.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/go_generics/globals/scope.go b/tools/go_generics/globals/scope.go
index 96c965ea2..eec93534b 100644
--- a/tools/go_generics/globals/scope.go
+++ b/tools/go_generics/globals/scope.go
@@ -72,6 +72,10 @@ func (s *scope) deepLookup(n string) *symbol {
}
func (s *scope) add(name string, kind SymKind, pos token.Pos) {
+ if s.syms[name] != nil {
+ return
+ }
+
s.syms[name] = &symbol{
kind: kind,
pos: pos,