aboutsummaryrefslogtreecommitdiff
path: root/test/method2.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2022-01-08 13:01:37 -0800
committerRobert Griesemer <gri@golang.org>2022-01-10 22:48:40 +0000
commit6019a52d4dab7c243ee9088c3522c821c0c95cfa (patch)
tree6214fff11c99576b245dc5a1efed0e83972b98d2 /test/method2.go
parent1f411e9b6d8849014653c89a9df77b8aadd082e6 (diff)
downloadgo-6019a52d4dab7c243ee9088c3522c821c0c95cfa.tar.gz
go-6019a52d4dab7c243ee9088c3522c821c0c95cfa.zip
go/types, types2: better error message when using *interface instead of interface
- detect *interface case and report specific error - replaced switch with sequence of if's for more clarity - fixed isInterfacePtr: it applies to all interfaces, incl. type parameters - reviewed/fixed all uses of isInterfacePtr - adjusted error messages to be consistently of the format "type %s is pointer to interface, not interface" Fixes #48312. Change-Id: Ic3c8cfcf93ad57ecdb60f6a727cce9e1aa4afb5d Reviewed-on: https://go-review.googlesource.com/c/go/+/376914 Trust: Robert Griesemer <gri@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'test/method2.go')
-rw-r--r--test/method2.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/method2.go b/test/method2.go
index 2a92136d6c..0a497b4b84 100644
--- a/test/method2.go
+++ b/test/method2.go
@@ -28,7 +28,7 @@ type Val interface {
val() int
}
-var _ = (*Val).val // ERROR "method"
+var _ = (*Val).val // ERROR "method|type \*Val is pointer to interface, not interface"
var v Val
var pv = &v