diff options
author | Daniel Morsing <daniel.morsing@gmail.com> | 2012-09-01 13:52:55 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2012-09-01 13:52:55 -0400 |
commit | 1c2021ca142677fbfbbea950dd5a35986d86e678 (patch) | |
tree | 04035afbc24479e8d14c446c1ffd16cd54ecb299 /test/interface | |
parent | 8f3c2055bd17c08d82f1ea56299802e476788307 (diff) | |
download | go-1c2021ca142677fbfbbea950dd5a35986d86e678.tar.gz go-1c2021ca142677fbfbbea950dd5a35986d86e678.zip |
cmd/gc: Suggest *T in error for x.(T) if it would work.
Accomplished by synchronizing the formatting of conversion errors between typecheck.c and subr.c
Fixes #3984.
R=golang-dev, remyoudompheng, rsc
CC=golang-dev
https://golang.org/cl/6500064
Diffstat (limited to 'test/interface')
-rw-r--r-- | test/interface/explicit.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/interface/explicit.go b/test/interface/explicit.go index 7822b88d08..eb81156e08 100644 --- a/test/interface/explicit.go +++ b/test/interface/explicit.go @@ -15,6 +15,10 @@ type T struct { var t *T +type X int + +func (x *X) M() {} + type I interface { M() } @@ -66,6 +70,8 @@ func (Int) M(float64) {} var _ = m.(Int) // ERROR "impossible type assertion" +var _ = m.(X) // ERROR "pointer receiver" + var ii int var jj Int |