summaryrefslogtreecommitdiff
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
commitd8c046c5a10787a5d76418ec4755d69fc475ae1d (patch)
treeca6de2a651e24d6a924e91e70a1fd5ed78933708 /test/method2.go
parente8ee91b454ee862b8bade379d189d1a4eb09b813 (diff)
downloadgo-d8c046c5a10787a5d76418ec4755d69fc475ae1d.tar.gz
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 000000000..3ee0ae136
--- /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"