1// compile 2 3// Copyright 2013 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// Test multiple identical unnamed structs with methods. This caused 8// a compilation error with gccgo. 9 10package p 11 12type S1 struct{} 13 14func (s S1) M() {} 15 16type S2 struct { 17 F1 struct { 18 S1 19 } 20 F2 struct { 21 S1 22 } 23} 24 25type I interface { 26 M() 27} 28 29func F() { 30 var s2 S2 31 var i1 I = s2.F1 32 var i2 I = s2.F2 33 _, _ = i1, i2 34} 35