summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2009-01-15 11:23:35 -0800
committerIan Lance Taylor <iant@golang.org>2009-01-15 11:23:35 -0800
commitd6b313278a61f109ab8b71dd8c77a40ff557b819 (patch)
treec66d805f9d31905fbc405e5f86a2d0cbc0072881
parentbd310bcb62632885584bd702ef52310e8b30ab91 (diff)
downloadgolang-d6b313278a61f109ab8b71dd8c77a40ff557b819.tar.gz
Test that a const with an explicit type is not treated as
having an abstract type. R=gri DELTA=11 (11 added, 0 deleted, 0 changed) OCL=22829 CL=22832
-rw-r--r--test/bugs/bug131.go12
-rw-r--r--test/golden.out3
2 files changed, 15 insertions, 0 deletions
diff --git a/test/bugs/bug131.go b/test/bugs/bug131.go
new file mode 100644
index 000000000..96e7cc764
--- /dev/null
+++ b/test/bugs/bug131.go
@@ -0,0 +1,12 @@
+// errchk $G $D/$F.go
+
+// Copyright 2009 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.
+
+package main
+
+func main() {
+ const a uint64 = 10;
+ var b int64 = a;
+}
diff --git a/test/golden.out b/test/golden.out
index a74d96bcd..326327bbc 100644
--- a/test/golden.out
+++ b/test/golden.out
@@ -143,6 +143,9 @@ BUG129
bugs/bug130.go:14: fatal error: getoutarg: not a func RANGE
BUG: should run
+=========== bugs/bug131.go
+BUG: should not compile
+
=========== fixedbugs/bug016.go
fixedbugs/bug016.go:7: overflow converting constant to uint