blob: 933f3f1ccc2a8ef1d604ea01b0b10f56ae1606b5 [file] [log] [blame]
Rémy Oudompheng2ece2f52012-02-18 22:15:42 +01001// run
Ian Lance Taylor4b4c6ab2010-02-08 15:40:09 -08002
Emmanuel Odeke53fd5222016-04-10 14:32:26 -07003// Copyright 2010 The Go Authors. All rights reserved.
Ian Lance Taylor4b4c6ab2010-02-08 15:40:09 -08004// Use of this source code is governed by a BSD-style
5// license that can be found in the LICENSE file.
6
7package main
8
9type S1 struct {
10 i int
11}
12type S2 struct {
13 i int
14}
15type S3 struct {
16 S1
17 S2
18}
19type S4 struct {
20 S3
21 S1
22}
Russ Cox00f9f0c2010-03-30 10:34:57 -070023
Ian Lance Taylor4b4c6ab2010-02-08 15:40:09 -080024func main() {
25 var s4 S4
Russ Cox00f9f0c2010-03-30 10:34:57 -070026 if s4.i != 0 { // .i refers to s4.S1.i, unambiguously
27 panic("fail")
Ian Lance Taylor4b4c6ab2010-02-08 15:40:09 -080028 }
29}