Rémy Oudompheng | 2ece2f5 | 2012-02-18 22:15:42 +0100 | [diff] [blame] | 1 | // run |
Luuk van Dijk | 11075ed | 2011-11-03 17:51:15 +0100 | [diff] [blame] | 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 | } |