]> Cypherpunks repositories - gostls13.git/commitdiff
unexpected shift conversion behavior
authorRobert Griesemer <gri@golang.org>
Fri, 21 Aug 2009 21:14:25 +0000 (14:14 -0700)
committerRobert Griesemer <gri@golang.org>
Fri, 21 Aug 2009 21:14:25 +0000 (14:14 -0700)
R=r
DELTA=20  (20 added, 0 deleted, 0 changed)
OCL=33646
CL=33667

test/bugs/bug193.go [new file with mode: 0644]
test/golden.out

diff --git a/test/bugs/bug193.go b/test/bugs/bug193.go
new file mode 100644 (file)
index 0000000..df768b9
--- /dev/null
@@ -0,0 +1,15 @@
+// errchk $G $D/$F.go
+
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+func main() {
+       s := uint(10);
+       ss := 1<<s;
+       y1 := float(ss);
+       y2 := float(1<<s);  // ERROR "shift"
+       y3 := string(1<<s);  // ERROR "shift"
+}
index 1c4981b352bbf4829e25fc637f907bac1460270f..6dc5cc66a66e9e0435ecd7e32cfc6c4e3fc9bef1 100644 (file)
@@ -168,3 +168,8 @@ bugs/bug190.go:13: invalid recursive type chan S
 bugs/bug190.go:16: invalid recursive type S
 bugs/bug190.go:15: invalid recursive type func(S) (S)
 BUG: should compile
+
+=========== bugs/bug193.go
+BUG: errchk: bugs/bug193.go:13: error message does not match 'shift'
+bugs/bug193.go:13: fatal error: optoas: no entry LSH-float
+errchk: bugs/bug193.go:14: missing expected error: 'shift'