1// run 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// Issue 38515: failed to mark the method wrapper 8// reflect.Type.Method itself as REFLECTMETHOD. 9 10package main 11 12import "reflect" 13 14var called bool 15 16type foo struct{} 17 18func (foo) X() { called = true } 19 20var h = reflect.Type.Method 21 22func main() { 23 v := reflect.ValueOf(foo{}) 24 m := h(v.Type(), 0) 25 f := m.Func.Interface().(func(foo)) 26 f(foo{}) 27 if !called { 28 panic("FAIL") 29 } 30} 31