2012-12-22 11:13:45 -07:00
|
|
|
// errorcheck
|
|
|
|
|
2016-04-10 15:32:26 -06:00
|
|
|
// Copyright 2012 The Go Authors. All rights reserved.
|
2012-12-22 11:13:45 -07: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 12:53:55 -07:00
|
|
|
(**T).foo(&pav) // ERROR "no method .*foo|requires named type or pointer to named|undefined"
|
2012-12-22 11:13:45 -07:00
|
|
|
}
|