2019-12-30 17:49:53 -07:00
|
|
|
package builtins
|
|
|
|
|
|
|
|
func _() {
|
|
|
|
var (
|
2020-01-14 10:13:30 -07:00
|
|
|
aSlice []int //@item(builtinSlice, "aSlice", "[]int", "var")
|
|
|
|
aMap map[string]int //@item(builtinMap, "aMap", "map[string]int", "var")
|
|
|
|
aString string //@item(builtinString, "aString", "string", "var")
|
|
|
|
aArray [0]int //@item(builtinArray, "aArray", "[0]int", "var")
|
|
|
|
aArrayPtr *[0]int //@item(builtinArrayPtr, "aArrayPtr", "*[0]int", "var")
|
|
|
|
aChan chan int //@item(builtinChan, "aChan", "chan int", "var")
|
|
|
|
aPtr *int //@item(builtinPtr, "aPtr", "*int", "var")
|
|
|
|
aInt int //@item(builtinInt, "aInt", "int", "var")
|
2019-12-30 17:49:53 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
close() //@rank(")", builtinChan, builtinSlice)
|
|
|
|
|
|
|
|
append() //@rank(")", builtinSlice, builtinChan)
|
|
|
|
|
2020-01-14 10:13:30 -07:00
|
|
|
copy() //@rank(")", builtinSlice, builtinChan)
|
|
|
|
copy(aSlice, aS) //@rank(")", builtinSlice, builtinString)
|
|
|
|
copy(aS, aSlice) //@rank(",", builtinSlice, builtinString)
|
2019-12-30 17:49:53 -07:00
|
|
|
|
2020-01-14 10:13:30 -07:00
|
|
|
delete() //@rank(")", builtinMap, builtinChan)
|
|
|
|
delete(aMap, aS) //@rank(")", builtinString, builtinSlice)
|
2019-12-30 17:49:53 -07:00
|
|
|
|
|
|
|
len() //@rank(")", builtinSlice, builtinInt),rank(")", builtinMap, builtinInt),rank(")", builtinString, builtinInt),rank(")", builtinArray, builtinInt),rank(")", builtinArrayPtr, builtinPtr),rank(")", builtinChan, builtinInt)
|
|
|
|
|
|
|
|
cap() //@rank(")", builtinSlice, builtinMap),rank(")", builtinArray, builtinString),rank(")", builtinArrayPtr, builtinPtr),rank(")", builtinChan, builtinInt)
|
|
|
|
|
|
|
|
make() //@rank(")", builtinMap, builtinInt),rank(")", builtinChan, builtinInt),rank(")", builtinSlice, builtinInt)
|
|
|
|
|
|
|
|
var _ []int = make() //@rank(")", builtinSlice, builtinMap)
|
|
|
|
|
|
|
|
type myStruct struct{} //@item(builtinStructType, "myStruct", "struct{...}", "struct")
|
|
|
|
new() //@rank(")", builtinStructType, builtinInt)
|
|
|
|
var _ *myStruct = new() //@rank(")", builtinStructType, int)
|
2020-01-14 10:13:30 -07:00
|
|
|
|
|
|
|
for k := range a { //@rank(" {", builtinSlice, builtinInt),rank(" {", builtinString, builtinInt),rank(" {", builtinChan, builtinInt),rank(" {", builtinArray, builtinInt),rank(" {", builtinArrayPtr, builtinInt),rank(" {", builtinMap, builtinInt),
|
|
|
|
}
|
|
|
|
|
|
|
|
for k, v := range a { //@rank(" {", builtinSlice, builtinChan)
|
|
|
|
}
|
|
|
|
|
|
|
|
<-a //@rank(" //", builtinChan, builtinInt)
|
2019-12-30 17:49:53 -07:00
|
|
|
}
|