blob: e9a430f18f98bbbd1e52910d8100bc8515f1e02c [file] [log] [blame]
Cuong Manh Le04714172019-09-29 23:42:42 +07001// errorcheck
2
3// Copyright 2019 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// selector expression resolves incorrectly for defined
8// pointer types.
9
10package main
11
12type E struct{ f int }
13type T struct{ E }
14
15func (*T) f() int { return 0 }
16
17type P *T
18type PP **T
19
20func main() {
21 var x P
22 _ = x.f // ERROR "x\.f undefined \(type P has no field or method f\)"
23
24 var y PP
25 _ = y.f // ERROR "y\.f undefined \(type PP has no field or method f\)"
26}