1// Copyright 2017 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5package main
6
7import (
8        "reflect"
9        fake "./a" // 2nd package with name "reflect"
10)
11
12type T struct {
13        _ fake.Type
14}
15
16func (T) f()            {}
17func (T) G() (_ int)    { return }
18func (T) H() (_, _ int) { return }
19
20func main() {
21        var x T
22        typ := reflect.TypeOf(x)
23        for i := 0; i < typ.NumMethod(); i++ {
24                _ = typ.Method(i) // must not crash
25        }
26}
27