GoType[] type = callExpression.getBaseExpression().getType();
if ( type.length != 1 || ! (type[0] instanceof GoTypeFunction) )
return "";
GoTypeFunction function = (GoTypeFunction) type[0];
int pos = -1;
for (GoExpr expr : callExpression.getArguments()) {
pos++;
if ( expr.getTextOffset() == e.getTextOffset() && expr.getTextLength() == e.getTextLength() )
break;
}
GoType desiredType = function.getParameterType(pos);
if ( desiredType instanceof GoTypeFunction ) {
GoTypeFunction typeFunction = (GoTypeFunction) desiredType;
int i = 0;
stringBuilder.append("(");
GoType parameterType = null;
while ( (parameterType = typeFunction.getParameterType(i)) != null) {
stringList.add(String.format("arg%d", i));
if ( i > 0 )
stringBuilder.append(",");
stringBuilder.append(String.format("$v%d$ ", i));
stringBuilder.append(GoTypes.getRepresentation(parameterType, currentFile));
i++;
}
stringBuilder.append(")");
GoType[] results = typeFunction.getResultTypes();
if ( results.length > 1 ) stringBuilder.append("(");
for (int i1 = 0; i1 < results.length; i1++) {
GoType goType = results[i1];
if( i1 > 0)
stringBuilder.append(",");