modernc.org/gc@v1.0.1-0.20240304020402-f0dba7c97c2b/testdata/errchk/test/fixedbugs/bug173.go (about)

     1  // compile
     2  
     3  // Copyright 2009 The Go Authors. All rights reserved.
     4  // Use of this source code is governed by a BSD-style
     5  // license that can be found in the LICENSE file.
     6  
     7  // these used to fail because the runtime
     8  // functions that get called to implement them
     9  // expected string, not T.
    10  
    11  package main
    12  
    13  type T string
    14  func main() {
    15  	var t T = "hello";
    16  	println(t[0:4], t[4]);
    17  	for _, _ = range t {
    18  	}
    19  	for _ = range t {
    20  	}
    21  	for range t {
    22  	}
    23  }