aboutsummaryrefslogtreecommitdiffstats
path: root/test/complit1.go
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2017-07-26 13:08:14 -0700
committerDan Willemsen <dwillemsen@google.com>2017-07-26 13:14:12 -0700
commitc78f7149fedd171aa5e7b2071d601b4d21ce4773 (patch)
treeadbcec2da9660fc1e8303812f761738383c63d02 /test/complit1.go
parent3377874f67bcc7d200408ceb8b02169c4c3b201d (diff)
downloadplatform_prebuilts_go_linux-x86-c78f7149fedd171aa5e7b2071d601b4d21ce4773.tar.gz
platform_prebuilts_go_linux-x86-c78f7149fedd171aa5e7b2071d601b4d21ce4773.tar.bz2
platform_prebuilts_go_linux-x86-c78f7149fedd171aa5e7b2071d601b4d21ce4773.zip
Update prebuilts to go1.9rc1 ab/4215840
Test: m -j blueprint_tools Change-Id: I8ce0d15553d871a3e79dc5836260651c0e515b5c
Diffstat (limited to 'test/complit1.go')
-rw-r--r--test/complit1.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/complit1.go b/test/complit1.go
index 9dde9943..83695a9e 100644
--- a/test/complit1.go
+++ b/test/complit1.go
@@ -22,6 +22,10 @@ var (
_ = m[0][:] // ERROR "slice of unaddressable value"
_ = f()[:] // ERROR "slice of unaddressable value"
+ _ = 301[:] // ERROR "cannot slice"
+ _ = 3.1[:] // ERROR "cannot slice"
+ _ = true[:] // ERROR "cannot slice"
+
// these are okay because they are slicing a pointer to an array
_ = (&[3]int{1, 2, 3})[:]
_ = mp[0][:]
@@ -35,10 +39,15 @@ type T struct {
next *T
}
+type TP *T
+type Ti int
+
var (
_ = &T{0, 0, "", nil} // ok
_ = &T{i: 0, f: 0, s: "", next: {}} // ERROR "missing type in composite literal|omit types within composite literal"
_ = &T{0, 0, "", {}} // ERROR "missing type in composite literal|omit types within composite literal"
+ _ = TP{i: 0, f: 0, s: "", next: {}} // ERROR "invalid pointer type"
+ _ = &Ti{} // ERROR "invalid pointer type"
)
type M map[T]T