InferBinaryType infers the return type of a binary expression, given the type of its inputs.
(bin treebin.BinaryOperatorSymbol, leftType, rightType *types.T)
| 14 | // InferBinaryType infers the return type of a binary expression, given the type |
| 15 | // of its inputs. |
| 16 | func InferBinaryType(bin treebin.BinaryOperatorSymbol, leftType, rightType *types.T) *types.T { |
| 17 | o, ok := FindBinaryOverload(bin, leftType, rightType) |
| 18 | if !ok { |
| 19 | return nil |
| 20 | } |
| 21 | return o.ReturnType |
| 22 | } |
| 23 | |
| 24 | // FindBinaryOverload finds the correct type signature overload for the |
| 25 | // specified binary operator, given the types of its inputs. If an overload is |
nothing calls this directly
no test coverage detected
searching dependent graphs…