aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWayne Zuo <wdvxdr@golangcn.org>2022-05-05 21:46:51 +0800
committerMatthew Dempsky <mdempsky@google.com>2022-05-06 21:07:37 +0000
commitac39dbdf58e50a2575b891675e7d2e1400b20cfe (patch)
tree68928d7ab8a34e9c2bf1b6dd6e8f6ff6b224bba2 /src
parent12420f9c01d6966c2994dbcc506a9d783a30ebdb (diff)
downloadgo-ac39dbdf58e50a2575b891675e7d2e1400b20cfe.tar.xz
cmd/compile: allow exporting `.rcvr` ident
Noder pass will build a closure to implement generic function instantiation which may produce `.dict` and `.rcvr` ident. Since we allow `.dict` during exporting, we should allow `.rcvr` too. Fixes #52241. Change-Id: Ifc3912ba5155b5ac1887f20830da64f4fb3fceb6 Reviewed-on: https://go-review.googlesource.com/c/go/+/404314 Run-TryBot: Wayne Zuo <wdvxdr@golangcn.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/cmd/compile/internal/typecheck/iexport.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/typecheck/iexport.go b/src/cmd/compile/internal/typecheck/iexport.go
index bf721d6495..d6a7eade03 100644
--- a/src/cmd/compile/internal/typecheck/iexport.go
+++ b/src/cmd/compile/internal/typecheck/iexport.go
@@ -2188,7 +2188,7 @@ func (w *exportWriter) localIdent(s *types.Sym) {
return
}
- if i := strings.LastIndex(name, "."); i >= 0 && !strings.HasPrefix(name, LocalDictName) {
+ if i := strings.LastIndex(name, "."); i >= 0 && !strings.HasPrefix(name, LocalDictName) && !strings.HasPrefix(name, ".rcvr") {
base.Fatalf("unexpected dot in identifier: %v", name)
}