]> Cypherpunks.ru repositories - gostls13.git/commitdiff
update convlit.go to current spec
authorRuss Cox <rsc@golang.org>
Tue, 5 May 2009 18:23:39 +0000 (11:23 -0700)
committerRuss Cox <rsc@golang.org>
Tue, 5 May 2009 18:23:39 +0000 (11:23 -0700)
R=r
DELTA=17  (2 added, 9 deleted, 6 changed)
OCL=28286
CL=28286

test/convlit.go
test/golden.out

index cfa7727123cbac5e85eec08bf2fc054f170c507d..be12e63835455f6eb4296d19c4e9744246cc5ec6 100644 (file)
@@ -4,18 +4,18 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// ! errchk $G -e $D/$F.go
-
 package main
 
-// explicit conversions are okay, even if they overflow
+// 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.
 var x1 = string(1);
 var x2 string = string(1);
-var x3 = int(1.5);
-var x4 int = int(1.5);
+var x3 = int(1.5);     // ERROR "convert|truncate"
+var x4 int = int(1.5); // ERROR "convert|truncate"
 var x5 = "a" + string(1);
-var x6 = int(1e100);
-var x7 = float(1e1000);
+var x6 = int(1e100);   // ERROR "overflow"
+var x7 = float(1e1000);        // ERROR "overflow"
 
 // implicit conversions merit scrutiny
 var s string;
index a3ab91b21305077704d36203bf07f08a8f9f7e45..72680adea32fea3ae7f5dee0491f617e69d989a2 100644 (file)
@@ -23,15 +23,6 @@ throw: interface hash
 
 panic PC=xxx
 
-=========== ./convlit.go
-BUG: errchk: ./convlit.go: unmatched error messages:
-==================================================
-./convlit.go:8: constant 1.5 truncated to integer
-./convlit.go:11: constant 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 overflows int
-./convlit.go:12: constant 34911850510716223476646871064527264675788468424693128821036252992306087892081078460155404277013793117885253p+2968 overflows float
-./convlit.go:9: constant 1.5 truncated to integer
-==================================================
-
 =========== ./helloworld.go
 hello, world