2012-12-22 18:13:45 +00:00
|
|
|
// errorcheck
|
|
|
|
|
2016-04-10 21:32:26 +00:00
|
|
|
// Copyright 2012 The Go Authors. All rights reserved.
|
2012-12-22 18:13:45 +00:00
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
// Issue 4458: gc accepts invalid method expressions
|
|
|
|
// like (**T).Method.
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
type T struct{}
|
|
|
|
|
|
|
|
func (T) foo() {}
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
av := T{}
|
|
|
|
pav := &av
|
2020-12-14 19:53:55 +00:00
|
|
|
(**T).foo(&pav) // ERROR "no method .*foo|requires named type or pointer to named|undefined"
|
2012-12-22 18:13:45 +00:00
|
|
|
}
|