summaryrefslogtreecommitdiff
path: root/test/blank1.go
diff options
context:
space:
mode:
authorDaniel Morsing <daniel.morsing@gmail.com>2013-03-04 17:01:42 +0100
committerDaniel Morsing <daniel.morsing@gmail.com>2013-03-04 17:01:42 +0100
commitf10e7087ffef817b6a7d06e711a179e560432119 (patch)
tree18c233a1fa1e5426570c28f9f8defe105328e934 /test/blank1.go
parent19e62b20c77006d4451407b8a9b9c48947f5c2cc (diff)
downloadgo-f10e7087ffef817b6a7d06e711a179e560432119.tar.gz
cmd/gc: disallow selectors to the blank identifier
Fixes issue 4941. R=golang-dev, rsc CC=golang-dev https://codereview.appspot.com/7415051
Diffstat (limited to 'test/blank1.go')
-rw-r--r--test/blank1.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/blank1.go b/test/blank1.go
index c6e038a0d..4edb2db70 100644
--- a/test/blank1.go
+++ b/test/blank1.go
@@ -9,8 +9,13 @@
package _ // ERROR "invalid package name _"
+var t struct {
+ _ int
+}
+
func main() {
_() // ERROR "cannot use _ as value"
x := _+1 // ERROR "cannot use _ as value"
_ = x
+ _ = t._ // ERROR "cannot refer to blank field"
}