MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / ReType

Function ReType

pkg/sql/sem/tree/normalize.go:977–984  ·  view source on GitHub ↗

ReType ensures that the given numeric expression evaluates to the requested type, inserting a cast if necessary.

(expr TypedExpr, wantedType *types.T)

Source from the content-addressed store, hash-verified

975// ReType ensures that the given numeric expression evaluates
976// to the requested type, inserting a cast if necessary.
977func ReType(expr TypedExpr, wantedType *types.T) TypedExpr {
978 if expr.ResolvedType().Equivalent(wantedType) {
979 return expr
980 }
981 res := &CastExpr{Expr: expr, Type: wantedType}
982 res.typ = wantedType
983 return res
984}

Callers 3

normalizeMethod · 0.85
VisitPostMethod · 0.85
VisitPostMethod · 0.85

Calls 2

EquivalentMethod · 0.80
ResolvedTypeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…