]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: improve error when setting unexported fields
authorEmmanuel T Odeke <emmanuel@orijtech.com>
Thu, 17 Oct 2019 06:13:25 +0000 (23:13 -0700)
committerEmmanuel Odeke <emm.odeke@gmail.com>
Fri, 8 May 2020 20:44:01 +0000 (20:44 +0000)
commit7cbee1244437bafa1e52ca761d7c32d7587a9fdd
tree314c942c57beefd2a52fde353e302240cd2edaeb
parent65126c588e5c3ea73cd6721f831b01957f7ecbe0
cmd/compile: improve error when setting unexported fields

Improve the error user experience when users try to set/refer
to unexported fields and methods of struct literals, by directly saying

    "cannot refer to unexported field or method"

Fixes #31053

Change-Id: I6fd3caf64b7ca9f9d8ea60b7756875e340792d59
Reviewed-on: https://go-review.googlesource.com/c/go/+/201657
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/compile/internal/gc/typecheck.go
test/fixedbugs/issue25727.go
test/fixedbugs/issue31053.dir/f1.go [new file with mode: 0644]
test/fixedbugs/issue31053.dir/main.go [new file with mode: 0644]
test/fixedbugs/issue31053.go [new file with mode: 0644]