Rémy Oudompheng | a9e119a | 2013-08-29 10:00:58 +0200 | [diff] [blame] | 1 | // compile |
| 2 | |
Emmanuel Odeke | 53fd522 | 2016-04-10 14:32:26 -0700 | [diff] [blame] | 3 | // Copyright 2013 The Go Authors. All rights reserved. |
Rémy Oudompheng | a9e119a | 2013-08-29 10:00:58 +0200 | [diff] [blame] | 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 6140: compiler incorrectly rejects method values |
| 8 | // whose receiver has an unnamed interface type. |
| 9 | |
| 10 | package p |
| 11 | |
| 12 | type T *interface { |
| 13 | m() int |
| 14 | } |
| 15 | |
| 16 | var x T |
| 17 | |
| 18 | var _ = (*x).m |
| 19 | |
| 20 | var y interface { |
| 21 | m() int |
| 22 | } |
| 23 | |
| 24 | var _ = y.m |
| 25 | |
| 26 | type I interface { |
| 27 | String() string |
| 28 | } |
| 29 | |
| 30 | var z *struct{ I } |
| 31 | var _ = z.String |