2012-02-16 21:49:59 -07:00
|
|
|
// errorcheck
|
2010-05-24 15:22:54 -06:00
|
|
|
|
2016-04-10 15:32:26 -06:00
|
|
|
// Copyright 2010 The Go Authors. All rights reserved.
|
2010-05-24 15:22:54 -06:00
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
// This is a test case for issue 804.
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
func f() [10]int {
|
|
|
|
return [10]int{}
|
|
|
|
}
|
|
|
|
|
|
|
|
var m map[int][10]int
|
|
|
|
|
|
|
|
func main() {
|
2010-09-01 22:04:57 -06:00
|
|
|
f()[1] = 2 // ERROR "cannot|invalid"
|
|
|
|
f()[2:3][0] = 4 // ERROR "cannot|addressable"
|
2010-05-24 15:22:54 -06:00
|
|
|
var x = "abc"
|
2010-09-01 22:04:57 -06:00
|
|
|
x[2] = 3 // ERROR "cannot|invalid"
|
|
|
|
m[0][5] = 6 // ERROR "cannot|invalid"
|
2010-05-24 15:22:54 -06:00
|
|
|
}
|