1
0
mirror of https://github.com/golang/go synced 2024-11-22 06:14:39 -07:00

update convlit.go to current spec

R=r
DELTA=17  (2 added, 9 deleted, 6 changed)
OCL=28286
CL=28286
This commit is contained in:
Russ Cox 2009-05-05 11:23:39 -07:00
parent 2067b9fb92
commit 21c9f82f40
2 changed files with 7 additions and 16 deletions

View 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;

View 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