1// run 2 3// Copyright 2010 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 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} 23 24func main() { 25 var s4 S4 26 if s4.i != 0 { // .i refers to s4.S1.i, unambiguously 27 panic("fail") 28 } 29} 30