Source file test/fixedbugs/issue23536.go

     1  // run
     2  
     3  // Copyright 2022 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  // Test case where a slice of a user-defined byte type (not uint8 or byte) is
     8  // converted to a string.  Same for slice of runes.
     9  
    10  package main
    11  
    12  type MyByte byte
    13  
    14  type MyRune rune
    15  
    16  func main() {
    17  	var y []MyByte
    18  	_ = string(y)
    19  
    20  	var z []MyRune
    21  	_ = string(z)
    22  }
    23  

View as plain text