blob: 10c48287d3a15060dcabf30377ab486c351998b3 [file] [log] [blame]
Ian Lance Taylor9bea6f32013-12-10 10:47:30 -08001// 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// Using the same name for a field in a composite literal and for a
8// global variable that depends on the variable being initialized
9// caused gccgo to erroneously report "variable initializer refers to
10// itself".
11
12package p
13
14type S struct {
15 F int
16}
17
18var V = S{F: 1}
19
20var F = V.F