github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/gnovm/tests/files/composite16.gno (about)

     1  package main
     2  
     3  func x(n int) int {
     4  	println(n)
     5  	return n
     6  }
     7  
     8  func main() {
     9  	x := []int{
    10  		x(1): x(2),
    11  		x(3): x(4),
    12  	}
    13  	println(x)
    14  }
    15  
    16  // Output:
    17  // 1
    18  // 2
    19  // 3
    20  // 4
    21  // slice[(0 int),(2 int),(0 int),(4 int)]