summaryrefslogtreecommitdiff
path: root/test/convlit.go
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2012-02-19 13:19:43 +1100
committerRob Pike <r@golang.org>2012-02-19 13:19:43 +1100
commitf48372c05c400812178b0bb68cd6525601cecfe9 (patch)
tree096926af13a4fbedd753a04c8f1fc2b01f90ca67 /test/convlit.go
parente26c8a1ce98dd9d924496b224a9d1d9edea538a2 (diff)
downloadgo-f48372c05c400812178b0bb68cd6525601cecfe9.tar.gz
test: [a-c]: add introductory comments to tests
Very few of the compiler regression tests include a comment saying waht they do. Many are obvious, some are anything but. I've started with a-c in the top directory. More will follow once we agree on the approach, correctness, and thoroughness here. zerodivide.go sneaked in too. R=rsc, r CC=golang-dev http://codereview.appspot.com/5656100
Diffstat (limited to 'test/convlit.go')
-rw-r--r--test/convlit.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/convlit.go b/test/convlit.go
index 964481dc9..8a6145d2a 100644
--- a/test/convlit.go
+++ b/test/convlit.go
@@ -4,11 +4,12 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Verify that illegal assignments with both explicit and implicit conversions of literals are detected.
+// Does not compile.
+
package main
-// explicit conversion of constants is work in progress.
-// the ERRORs in this block are debatable, but they're what
-// the language spec says for now.
+// explicit conversion of constants
var x1 = string(1)
var x2 string = string(1)
var x3 = int(1.5) // ERROR "convert|truncate"