build: separate compiler and libs
This commit is contained in:
33
compiler/cl/_testrt/index/in.go
Normal file
33
compiler/cl/_testrt/index/in.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package main
|
||||
|
||||
type point struct {
|
||||
x int
|
||||
y int
|
||||
}
|
||||
|
||||
type N [2]int
|
||||
type T *N
|
||||
type S []int
|
||||
|
||||
func main() {
|
||||
a := [...]point{{1, 2}, {3, 4}, {5, 6}}[2]
|
||||
println(a.x, a.y)
|
||||
|
||||
b := [...][2]int{[2]int{1, 2}, [2]int{3, 4}}[1]
|
||||
println(b[0], b[1])
|
||||
|
||||
var i int = 2
|
||||
println([...]int{1, 2, 3, 4, 5}[i])
|
||||
|
||||
s := "123456"
|
||||
println(string(s[i]))
|
||||
println(string("123456"[1]))
|
||||
|
||||
var n = N{1, 2}
|
||||
var t T = &n
|
||||
println(t[1])
|
||||
var s1 = S{1, 2, 3, 4}
|
||||
println(s1[1])
|
||||
|
||||
println([2]int{}[0])
|
||||
}
|
||||
Reference in New Issue
Block a user