test/fixedbugs/bug253.go
raw| 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 | |
| 7 | package main |
| 8 | |
| 9 | type S1 struct { |
| 10 | i int |
| 11 | } |
| 12 | type S2 struct { |
| 13 | i int |
| 14 | } |
| 15 | type S3 struct { |
| 16 | S1 |
| 17 | S2 |
| 18 | } |
| 19 | type S4 struct { |
| 20 | S3 |
| 21 | S1 |
| 22 | } |
| 23 | |
| 24 | func main() { |
| 25 | var s4 S4 |
| 26 | if s4.i != 0 { // .i refers to s4.S1.i, unambiguously |
| 27 | panic("fail") |
| 28 | } |
| 29 | } |