2008-06-06 17:56:18 -06: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 12:58:52 -06:00
|
|
|
i = digits[7]; // ERROR "illegal|is not|invalid"
|
2009-09-15 13:42:24 -06:00
|
|
|
_ = i;
|
2008-06-06 17:56:18 -06:00
|
|
|
}
|
|
|
|
|
2008-07-07 11:03:10 -06:00
|
|
|
func main() {
|
|
|
|
s := "asdfasdfasdfasdf";
|
|
|
|
putint(&s);
|
|
|
|
}
|
|
|
|
|
2008-06-06 17:56:18 -06:00
|
|
|
/*
|
|
|
|
bug022.go:8: illegal types for operand
|
|
|
|
(*<string>*STRING) INDEXPTR (<int32>INT32)
|
|
|
|
bug022.go:8: illegal types for operand
|
2009-06-25 15:44:09 -06:00
|
|
|
(<uint8>UINT8) AS
|
2008-06-06 17:56:18 -06:00
|
|
|
*/
|