]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: report the struct type in invalid number of initializer values
authorEmmanuel Odeke <emm.odeke@gmail.com>
Sun, 11 Feb 2018 04:10:26 +0000 (20:10 -0800)
committerEmmanuel Odeke <emm.odeke@gmail.com>
Tue, 13 Feb 2018 19:42:15 +0000 (19:42 +0000)
commit25d22d9abae4345c24cd2ae7f26de1846888faa4
tree0c5050b56306933b35a5414741b15de6a4192f24
parentdc3bef36354c7977cfd9e4459e1e6f31bc8624a6
cmd/compile: report the struct type in invalid number of initializer values

Fixes #23732

Disambiguate "too few" or "too many" values in struct
initializer messages by reporting the name of the literal.

After:
issue23732.go:27:3: too few values in Foo literal
issue23732.go:34:12: too many values in Bar literal
issue23732.go:40:6: too few values in Foo literal
issue23732.go:40:12: too many values in Bar literal

Change-Id: Ieca37298441d907ac78ffe960c5ab55741a362ef
Reviewed-on: https://go-review.googlesource.com/93277
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/typecheck.go
test/fixedbugs/issue23732.go [new file with mode: 0644]