aboutsummaryrefslogtreecommitdiff
path: root/test/method2.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2008-11-04 09:45:27 -0800
committerRuss Cox <rsc@golang.org>2008-11-04 09:45:27 -0800
commitd289e6344f6ed40d5e2e6646e32fc8a685f38c75 (patch)
treeca6de2a651e24d6a924e91e70a1fd5ed78933708 /test/method2.go
parent7cd11c1c09729cc3ade1289014865ed26b22c354 (diff)
downloadgo-d289e6344f6ed40d5e2e6646e32fc8a685f38c75.tar.gz
go-d289e6344f6ed40d5e2e6646e32fc8a685f38c75.zip
move invalid method uses to new test
R=iant DELTA=24 (13 added, 10 deleted, 1 changed) OCL=18424 CL=18439
Diffstat (limited to 'test/method2.go')
-rw-r--r--test/method2.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/method2.go b/test/method2.go
new file mode 100644
index 0000000000..3ee0ae1364
--- /dev/null
+++ b/test/method2.go
@@ -0,0 +1,14 @@
+// errchk $G $D/$F.go
+
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+type T struct {a int}
+type P *T
+type P1 *T
+
+func (p P) val() int { return 1 } // ERROR "receiver"
+func (p *P1) val() int { return 1 } // ERROR "receiver"