]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: better errors for structs with conflicting fields and methods
authorRobert Griesemer <gri@golang.org>
Tue, 23 Oct 2018 21:45:09 +0000 (14:45 -0700)
committerRobert Griesemer <gri@golang.org>
Wed, 24 Oct 2018 20:39:37 +0000 (20:39 +0000)
commit6761b1eb1b9fdbe5e2b865d683167dd5af3e5c0b
tree34f70dc46ae64ea7810119db51029a611762007d
parent4be3851d197c331a8789799b9bc54683f6fdd45b
cmd/compile: better errors for structs with conflicting fields and methods

If a field and method have the same name, mark the respective struct field
so that we don't report follow-on errors when the field/method is accessed.

Per suggestion of @mdempsky.

Fixes #28268.

Change-Id: Ia1ca4cdfe9bacd3739d1fd7ca5e014ca094245ee
Reviewed-on: https://go-review.googlesource.com/c/144259
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/dcl.go
src/cmd/compile/internal/gc/typecheck.go
test/fixedbugs/issue28268.go [new file with mode: 0644]