aboutsummaryrefslogtreecommitdiff
path: root/test/interface
diff options
context:
space:
mode:
authorDaniel Morsing <daniel.morsing@gmail.com>2012-09-01 13:52:55 -0400
committerRuss Cox <rsc@golang.org>2012-09-01 13:52:55 -0400
commit1c2021ca142677fbfbbea950dd5a35986d86e678 (patch)
tree04035afbc24479e8d14c446c1ffd16cd54ecb299 /test/interface
parent8f3c2055bd17c08d82f1ea56299802e476788307 (diff)
downloadgo-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.go6
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