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