MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / InferBinaryType

Function InferBinaryType

pkg/sql/sem/tree/typing.go:16–22  ·  view source on GitHub ↗

InferBinaryType infers the return type of a binary expression, given the type of its inputs.

(bin treebin.BinaryOperatorSymbol, leftType, rightType *types.T)

Source from the content-addressed store, hash-verified

14// InferBinaryType infers the return type of a binary expression, given the type
15// of its inputs.
16func 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

Callers

nothing calls this directly

Calls 1

FindBinaryOverloadFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…