Source file test/typeparam/issue47723.go

     1  // run
     2  
     3  // Copyright 2021 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  package main
     8  
     9  func f[_ any]() int {
    10  	var a [1]int
    11  	_ = func() int {
    12  		return func() int {
    13  			return 0
    14  		}()
    15  	}()
    16  	return a[func() int {
    17  		return 0
    18  	}()]
    19  }
    20  
    21  func main() {
    22  	f[int]()
    23  }
    24  

View as plain text