2008-06-06 23:56:18 +00:00
|
|
|
// errchk $G $D/$F.go
|
|
|
|
|
|
|
|
// Copyright 2009 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 putint(digits *string) {
|
|
|
|
var i byte;
|
|
|
|
i = (*digits)[7]; // compiles
|
2009-08-03 18:58:52 +00:00
|
|
|
i = digits[7]; // ERROR "illegal|is not|invalid"
|
2009-09-15 19:42:24 +00:00
|
|
|
_ = i;
|
2008-06-06 23:56:18 +00:00
|
|
|
}
|
|
|
|
|
2008-07-07 17:03:10 +00:00
|
|
|
func main() {
|
|
|
|
s := "asdfasdfasdfasdf";
|
|
|
|
putint(&s);
|
|
|
|
}
|
|
|
|
|
2008-06-06 23:56:18 +00:00
|
|
|
/*
|
|
|
|
bug022.go:8: illegal types for operand
|
|
|
|
(*<string>*STRING) INDEXPTR (<int32>INT32)
|
|
|
|
bug022.go:8: illegal types for operand
|
2009-06-25 21:44:09 +00:00
|
|
|
(<uint8>UINT8) AS
|
2008-06-06 23:56:18 +00:00
|
|
|
*/
|