diff options
author | Russ Cox <rsc@golang.org> | 2014-10-20 22:04:12 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2014-10-20 22:04:12 -0400 |
commit | 2043f3b47093bc0258c14f13200a29042cf137e9 (patch) | |
tree | b1e018f69d50ff42907b2d21f28c4c0cb2e214f7 /test | |
parent | e9ab7303f127c32b2021fa360e710e8e091d62c3 (diff) | |
download | go-2043f3b47093bc0258c14f13200a29042cf137e9.tar.gz |
cmd/gc: disallow call of *T method using **T variable
This brings cmd/gc in line with the spec on this question.
It might break existing code, but that code was not conformant
with the spec.
Credit to R?my for finding the broken code.
Fixes issue 6366.
LGTM=r
R=golang-codereviews, r
CC=adonovan, golang-codereviews, gri
https://codereview.appspot.com/129550043
Diffstat (limited to 'test')
-rw-r--r-- | test/fixedbugs/bug371.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/fixedbugs/bug371.go b/test/fixedbugs/bug371.go index 6329e9635..86c73bf4a 100644 --- a/test/fixedbugs/bug371.go +++ b/test/fixedbugs/bug371.go @@ -8,10 +8,10 @@ package main -type T struct {} +type T struct{} func (t *T) pm() {} -func (t T) m() {} +func (t T) m() {} func main() { p := &T{} @@ -20,5 +20,5 @@ func main() { q := &p q.m() // ERROR "requires explicit dereference" - q.pm() + q.pm() // ERROR "requires explicit dereference" } |