diff options
author | Dave Cheney <dave@cheney.net> | 2015-09-03 17:07:00 +1000 |
---|---|---|
committer | Dave Cheney <dave@cheney.net> | 2015-09-05 02:25:01 +0000 |
commit | 703bd8362350a0c1742d6eb9017ebbf13fcbbbdd (patch) | |
tree | 0f35c268027e3260b9643fd50bf8d9d137ec3efb /test/initloop.go | |
parent | 928fe05a4fc0f0e92d81f7b0f320014dad69105d (diff) | |
download | go-703bd8362350a0c1742d6eb9017ebbf13fcbbbdd.tar.gz go-703bd8362350a0c1742d6eb9017ebbf13fcbbbdd.zip |
cmd/compile: use []*Node instead of NodeList in sinit
This is a first of a set of changes to make the transition away from NodeList
easier by removing cases in which NodeList doesn't act semi-trivially like a
[]*Node.
This CL was originally prepared by Josh Bleecher Snyder <josharian@gmail.com>.
This change passes go build -toolexec 'toolstash -cmp' -a std.
Change-Id: Iad10b75e42b5b24e1694407841282fa3bab2dc9f
Reviewed-on: https://go-review.googlesource.com/14232
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'test/initloop.go')
-rw-r--r-- | test/initloop.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/initloop.go b/test/initloop.go new file mode 100644 index 0000000000..d90395d753 --- /dev/null +++ b/test/initloop.go @@ -0,0 +1,17 @@ +// errorcheck + +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Verify that initialization loops are caught +// and that the errors print correctly. + +package main + +var ( + x int = a + a int = b // ERROR "a refers to\n.*b refers to\n.*c refers to\n.*a" + b int = c + c int = a +) |