]> Cypherpunks.ru repositories - gostls13.git/blob - test/method2.go
gc, spec, tests: no auto-indirect of pointer to interface value
[gostls13.git] / test / method2.go
1 // errchk $G $D/$F.go
2
3 // Copyright 2009 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
6
7 package main
8
9 type T struct {
10         a int
11 }
12 type P *T
13 type P1 *T
14
15 func (p P) val() int   { return 1 } // ERROR "receiver"
16 func (p *P1) val() int { return 1 } // ERROR "receiver"
17
18 type Val interface {
19         val() int
20 }
21
22 var _ = (*Val).val // ERROR "method"
23
24 var v Val
25 var pv = &v
26
27 var _ = pv.val()        // ERROR "method"