1// run 2 3// Copyright 2011 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 2355 8package main 9 10type T struct {} 11func (T) m() string { return "T" } 12 13type TT struct { 14 T 15 m func() string 16} 17 18 19func ff() string { return "ff" } 20 21func main() { 22 var tt TT 23 tt.m = ff 24 25 if tt.m() != "ff" { 26 println(tt.m(), "!= \"ff\"") 27 } 28} 29