2012-02-18 14:15:42 -07:00
|
|
|
// compile
|
2009-07-27 16:16:28 -06:00
|
|
|
|
|
|
|
// 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.
|
|
|
|
|
|
|
|
// these used to fail because the runtime
|
|
|
|
// functions that get called to implement them
|
|
|
|
// expected string, not T.
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
type T string
|
|
|
|
func main() {
|
|
|
|
var t T = "hello";
|
|
|
|
println(t[0:4], t[4]);
|
2009-09-15 13:42:24 -06:00
|
|
|
for _, _ = range t {
|
2009-07-27 16:16:28 -06:00
|
|
|
}
|
2009-09-15 13:42:24 -06:00
|
|
|
for _ = range t {
|
2009-07-27 16:16:28 -06:00
|
|
|
}
|
2014-07-16 17:27:10 -06:00
|
|
|
for range t {
|
|
|
|
}
|
2009-07-27 16:16:28 -06:00
|
|
|
}
|