From: Russ Cox Date: Tue, 5 May 2009 18:23:39 +0000 (-0700) Subject: update convlit.go to current spec X-Git-Tag: weekly.2009-11-06~1716 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=21c9f82f40edca8d93d3c07f1546735aead243e4;p=gostls13.git update convlit.go to current spec R=r DELTA=17 (2 added, 9 deleted, 6 changed) OCL=28286 CL=28286 --- diff --git a/test/convlit.go b/test/convlit.go index cfa7727123..be12e63835 100644 --- a/test/convlit.go +++ b/test/convlit.go @@ -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; diff --git a/test/golden.out b/test/golden.out index a3ab91b213..72680adea3 100644 --- a/test/golden.out +++ b/test/golden.out @@ -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