| 1 |
// errorcheck |
| 2 |
|
| 3 |
// Copyright 2020 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 p |
| 8 |
|
| 9 |
import "time" |
| 10 |
|
| 11 |
type T int |
| 12 |
|
| 13 |
func (T) Mv() {} |
| 14 |
func (*T) Mp() {} |
| 15 |
|
| 16 |
var _ = []int{ |
| 17 |
T.Mv, // ERROR "cannot use T\.Mv|incompatible type" |
| 18 |
(*T).Mv, // ERROR "cannot use \(\*T\)\.Mv|incompatible type" |
| 19 |
(*T).Mp, // ERROR "cannot use \(\*T\)\.Mp|incompatible type" |
| 20 |
|
| 21 |
time.Time.GobEncode, // ERROR "cannot use time\.Time\.GobEncode|incompatible type" |
| 22 |
(*time.Time).GobEncode, // ERROR "cannot use \(\*time\.Time\)\.GobEncode|incompatible type" |
| 23 |
(*time.Time).GobDecode, // ERROR "cannot use \(\*time\.Time\)\.GobDecode|incompatible type" |
| 24 |
|
| 25 |
} |