1
0
mirror of https://github.com/golang/go synced 2024-10-04 23:31:22 -06:00
go/src
Caio Marcelo de Oliveira Filho 74c0fea9e8 go/types: better error when assigning to struct field in map
Identify this assignment case and instead of the more general error

    prog.go:6: cannot assign to students["sally"].age (value of type int)

produce

    prog.go:6: cannot directly assign to struct field students["sally"].age in map

that explains why the assignment is not possible. Used ExprString
instead of String of operand since the type of the field is not relevant
to the error.

Updates #13779.

Change-Id: I581251145ae6336ddd181b9ddd77f657c51b5aff
Reviewed-on: https://go-review.googlesource.com/21463
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-04-04 15:10:48 +00:00
..
archive all: delete dead test code 2016-03-21 07:10:08 +00:00
bufio all: delete dead test code 2016-03-21 07:10:08 +00:00
builtin
bytes all: delete dead test code 2016-03-21 07:10:08 +00:00
cmd cmd/compile: better error when assigning to struct field in map 2016-04-04 14:07:47 +00:00
compress compress/gzip: fix Reader.Reset 2016-04-02 23:36:21 +00:00
container all: single space after period. 2016-03-02 00:13:47 +00:00
crypto all: fix spelling mistakes 2016-04-03 17:03:15 +00:00
database/sql all: delete dead non-test code 2016-03-25 06:28:13 +00:00
debug all: fix spelling mistakes 2016-04-03 17:03:15 +00:00
encoding all: use bytes.Equal, bytes.Contains and strings.Contains 2016-04-01 02:05:01 +00:00
errors all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
expvar all: single space after period. 2016-03-02 00:13:47 +00:00
flag all: single space after period. 2016-03-02 00:13:47 +00:00
fmt fmt: hold on to all free buffers, regardless of size 2016-04-03 06:20:37 +00:00
go go/types: better error when assigning to struct field in map 2016-04-04 15:10:48 +00:00
hash hash/crc64: Add tests for ECMA polynomial 2016-03-31 20:42:02 +00:00
html html/template: prefix the internally-used FuncMap values with an underscore 2016-04-04 05:23:18 +00:00
image image/jpeg: reconstruct progressive images even if incomplete. 2016-03-31 00:33:24 +00:00
index/suffixarray
internal runtime, syscall: only search for Windows DLLs in the System32 directory 2016-04-01 22:55:36 +00:00
io all: delete dead non-test code 2016-03-25 06:28:13 +00:00
log all: single space after period. 2016-03-02 00:13:47 +00:00
math math/big: much simplified and faster Float rounding 2016-03-22 17:07:34 +00:00
mime mime: fix maximum length of encoded-words 2016-03-29 11:19:31 +00:00
net net: don't do DNS for onion and local addresses 2016-04-02 20:32:36 +00:00
os os: make IsExists also recognize syscall.ENOTEMPTY 2016-04-03 06:22:07 +00:00
path path, path/filepath: add Join example with joined rooted path 2016-04-03 16:55:51 +00:00
reflect reflect: implement StructOf 2016-04-01 14:56:21 +00:00
regexp all: delete dead non-test code 2016-03-25 06:28:13 +00:00
runtime runtime: change osyield to use Windows SwitchToThread 2016-04-04 10:05:05 +00:00
sort all: delete dead non-test code 2016-03-25 06:28:13 +00:00
strconv all: single space after period. 2016-03-02 00:13:47 +00:00
strings all: single space after period. 2016-03-02 00:13:47 +00:00
sync sync: don't assume b.N > 0 2016-03-18 16:37:39 +00:00
syscall syscall: add support for s390x 2016-04-03 22:12:35 +00:00
testing cmd/go: fix proc-count accumulation in benchmark name 2016-03-26 16:44:01 +00:00
text all: delete dead non-test code 2016-03-25 06:28:13 +00:00
time all: delete dead non-test code 2016-03-25 06:28:13 +00:00
unicode all: single space after period. 2016-03-02 00:13:47 +00:00
unsafe all: single space after period. 2016-03-02 00:13:47 +00:00
vendor/golang.org/x/net/http2/hpack all: fix spelling mistakes 2016-04-03 17:03:15 +00:00
all.bash
all.bat
all.rc
androidtest.bash
bootstrap.bash
buildall.bash
clean.bash
clean.bat
clean.rc
iostest.bash
make.bash cmd/dist: redo flag-passing for bootstrap 2016-03-18 19:00:03 +00:00
make.bat
Make.dist
make.rc
nacltest.bash
race.bash
race.bat
run.bash
run.bat
run.rc