Signature returns a human-readable signature. If simplify is bool, tuple-returning functions with just 1 tuple element unwrap the return type in the signature.
(simplify bool)
| 122 | // If simplify is bool, tuple-returning functions with just |
| 123 | // 1 tuple element unwrap the return type in the signature. |
| 124 | func (b Overload) Signature(simplify bool) string { |
| 125 | retType := b.FixedReturnType() |
| 126 | if simplify { |
| 127 | if retType.Family() == types.TupleFamily && len(retType.TupleContents()) == 1 { |
| 128 | retType = &retType.TupleContents()[0] |
| 129 | } |
| 130 | } |
| 131 | return fmt.Sprintf("(%s) -> %s", b.Types.String(), retType) |
| 132 | } |
| 133 | |
| 134 | // overloadImpl is an implementation of an overloaded function. It provides |
| 135 | // access to the parameter type list and the return type of the implementation. |
no test coverage detected