MCPcopy Create free account
hub / github.com/dolthub/doltgresql / TypeCheck

Method TypeCheck

postgres/parser/sem/tree/type_check.go:1134–1145  ·  view source on GitHub ↗

TypeCheck implements the Expr interface.

(
	ctx context.Context, semaCtx *SemaContext, desired *types.T,
)

Source from the content-addressed store, hash-verified

1132
1133// TypeCheck implements the Expr interface.
1134func (expr *NullIfExpr) TypeCheck(
1135 ctx context.Context, semaCtx *SemaContext, desired *types.T,
1136) (TypedExpr, error) {
1137 typedSubExprs, retType, err := TypeCheckSameTypedExprs(ctx, semaCtx, desired, expr.Expr1, expr.Expr2)
1138 if err != nil {
1139 return nil, decorateTypeCheckError(err, "incompatible NULLIF expressions")
1140 }
1141
1142 expr.Expr1, expr.Expr2 = typedSubExprs[0], typedSubExprs[1]
1143 expr.typ = retType
1144 return expr, nil
1145}
1146
1147// TypeCheck implements the Expr interface.
1148func (expr *OrExpr) TypeCheck(

Callers

nothing calls this directly

Calls 2

TypeCheckSameTypedExprsFunction · 0.85
decorateTypeCheckErrorFunction · 0.85

Tested by

no test coverage detected