(prefix string, candidates []overloadImpl)
| 860 | } |
| 861 | |
| 862 | func formatCandidates(prefix string, candidates []overloadImpl) string { |
| 863 | var buf bytes.Buffer |
| 864 | for _, candidate := range candidates { |
| 865 | buf.WriteString(prefix) |
| 866 | buf.WriteByte('(') |
| 867 | params := candidate.params() |
| 868 | tLen := params.Length() |
| 869 | inputTyps := make([]TypedExpr, tLen) |
| 870 | for i := 0; i < tLen; i++ { |
| 871 | t := params.GetAt(i) |
| 872 | inputTyps[i] = &TypedDummy{Typ: t} |
| 873 | if i > 0 { |
| 874 | buf.WriteString(", ") |
| 875 | } |
| 876 | buf.WriteString(t.String()) |
| 877 | } |
| 878 | buf.WriteString(") -> ") |
| 879 | buf.WriteString(returnTypeToFixedType(candidate.returnType(), inputTyps).String()) |
| 880 | if candidate.preferred() { |
| 881 | buf.WriteString(" [preferred]") |
| 882 | } |
| 883 | buf.WriteByte('\n') |
| 884 | } |
| 885 | return buf.String() |
| 886 | } |
no test coverage detected
searching dependent graphs…