Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
21c9f82f
Commit
21c9f82f
authored
May 05, 2009
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update convlit.go to current spec
R=r DELTA=17 (2 added, 9 deleted, 6 changed) OCL=28286 CL=28286
parent
2067b9fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
16 deletions
+7
-16
test/convlit.go
test/convlit.go
+7
-7
test/golden.out
test/golden.out
+0
-9
No files found.
test/convlit.go
View file @
21c9f82f
...
...
@@ -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
;
...
...
test/golden.out
View file @
21c9f82f
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment