• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2020 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
5// Test that a method *is* live if it matches an interface
6// method and the type is "indirectly" converted to an
7// interface through reflection.
8
9package main
10
11import "reflect"
12
13type I interface{ M() }
14
15type T int
16
17func (T) M() { println("XXX") }
18
19func main() {
20	e := reflect.ValueOf([]T{1}).Index(0).Interface()
21	e.(I).M()
22}
23