From 758ff64c69e34965f8af5b2d6ffd65e8d7ab2150 Mon Sep 17 00:00:00 2001 From: Ondřej Surý Date: Mon, 14 Feb 2011 13:23:51 +0100 Subject: Imported Upstream version 2011-02-01.1 --- test/syntax/chan1.go | 17 +++++++++++++++++ test/syntax/typesw.go | 13 +++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 test/syntax/chan1.go create mode 100644 test/syntax/typesw.go (limited to 'test/syntax') 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: + } +} -- cgit v1.2.3