Text file src/go/types/testdata/fixedbugs/issue45635.go2

     1  // Copyright 2021 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package main
     6  
     7  func main() {
     8  	some /* ERROR "undeclared name" */ [int, int]()
     9  }
    10  
    11  type N[T any] struct{}
    12  
    13  var _ N [] // ERROR expected type argument list
    14  
    15  type I interface {
    16  	~[]int
    17  }
    18  
    19  func _[T I](i, j int) {
    20  	var m map[int]int
    21  	_ = m[i, j /* ERROR "more than one index" */ ]
    22  
    23  	var a [3]int
    24  	_ = a[i, j /* ERROR "more than one index" */ ]
    25  
    26  	var s []int
    27  	_ = s[i, j /* ERROR "more than one index" */ ]
    28  
    29  	var t T
    30  	_ = t[i, j /* ERROR "more than one index" */ ]
    31  }
    32  

View as plain text