if (functionName.equals("append")) {
if (args.length > 1) {
GoType[] types = args[0].getType();
if (types.length > 0 && types[0] instanceof GoTypeSlice) {
GoPsiTypeSlice appendedSlice = ((GoTypeSlice) types[0]).getPsiType();
GoPsiType[] result = new GoPsiType[args.length];
result[0] = appendedSlice;
if (isCallWithVariadicParameter()){
result[1] = appendedSlice;
return result;
}
GoPsiType elem = appendedSlice.getElementType();
for (int i = 1; i < args.length; i++) {
result[i] = elem;
}
return result;
}
}
} else if (functionName.equals("copy")) {
if (args.length == 2) {
GoType[] types = args[0].getType();
if (types.length > 0 && types[0] instanceof GoTypeSlice) {
GoPsiTypeSlice copiedSlice = ((GoTypeSlice) types[0]).getPsiType();
return new GoPsiType[]{copiedSlice, copiedSlice};
}
}
} else if (functionName.equals("delete")) {
if (args.length == 2) {