diff options
author | Ondřej Surý <ondrej@sury.org> | 2011-02-14 13:23:51 +0100 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2011-02-14 13:23:51 +0100 |
commit | 758ff64c69e34965f8af5b2d6ffd65e8d7ab2150 (patch) | |
tree | 6d6b34f8c678862fe9b56c945a7b63f68502c245 /test/syntax | |
parent | 3e45412327a2654a77944249962b3652e6142299 (diff) | |
download | golang-758ff64c69e34965f8af5b2d6ffd65e8d7ab2150.tar.gz |
Imported Upstream version 2011-02-01.1upstream/2011-02-01.1
Diffstat (limited to 'test/syntax')
-rw-r--r-- | test/syntax/chan1.go | 17 | ||||
-rw-r--r-- | test/syntax/typesw.go | 13 |
2 files changed, 30 insertions, 0 deletions
diff --git a/test/syntax/chan1.go b/test/syntax/chan1.go new file mode 100644 index 000000000..9c12e5e6f --- /dev/null +++ b/test/syntax/chan1.go @@ -0,0 +1,17 @@ +// errchk $G -e $D/$F.go + +// Copyright 2010 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 + +var c chan int +var v int + +func main() { + if c <- v { // ERROR "send statement.*value.*select" + } +} + +var _ = c <- v // ERROR "send statement.*value.*select" diff --git a/test/syntax/typesw.go b/test/syntax/typesw.go new file mode 100644 index 000000000..47f683cdf --- /dev/null +++ b/test/syntax/typesw.go @@ -0,0 +1,13 @@ +// errchk $G -e $D/$F.go + +// Copyright 2011 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() { + switch main() := interface{}(nil).(type) { // ERROR "invalid variable name" + default: + } +} |