2012-02-16 23:49:59 -05:00
|
|
|
// errorcheck
|
2011-11-02 17:18:53 +01:00
|
|
|
|
2016-04-10 14:32:26 -07:00
|
|
|
// Copyright 2011 The Go Authors. All rights reserved.
|
2011-11-02 17:18:53 +01:00
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
// issue 2343
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
2014-10-20 22:04:12 -04:00
|
|
|
type T struct{}
|
2011-11-02 17:18:53 +01:00
|
|
|
|
|
|
|
func (t *T) pm() {}
|
2014-10-20 22:04:12 -04:00
|
|
|
func (t T) m() {}
|
2011-11-02 17:18:53 +01:00
|
|
|
|
|
|
|
func main() {
|
|
|
|
p := &T{}
|
|
|
|
p.pm()
|
|
|
|
p.m()
|
|
|
|
|
|
|
|
q := &p
|
2020-12-09 20:14:07 -08:00
|
|
|
q.m() // ERROR "requires explicit dereference|undefined"
|
|
|
|
q.pm() // ERROR "requires explicit dereference|undefined"
|
2011-11-02 17:18:53 +01:00
|
|
|
}
|