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

Function defaultTypeCheck

pkg/sql/sem/tree/overload.go:779–797  ·  view source on GitHub ↗

defaultTypeCheck type checks the constant and placeholder expressions without a preference and adds them to the type checked slice.

(ctx *SemaContext, s *typeCheckOverloadState, errorOnPlaceholders bool)

Source from the content-addressed store, hash-verified

777// defaultTypeCheck type checks the constant and placeholder expressions without a preference
778// and adds them to the type checked slice.
779func defaultTypeCheck(ctx *SemaContext, s *typeCheckOverloadState, errorOnPlaceholders bool) error {
780 for _, i := range s.constIdxs {
781 typ, err := s.exprs[i].TypeCheck(ctx, types.Any)
782 if err != nil {
783 return pgerror.Wrapf(err, pgcode.InvalidParameterValue,
784 "error type checking constant value")
785 }
786 s.typedExprs[i] = typ
787 }
788 for _, i := range s.placeholderIdxs {
789 if errorOnPlaceholders {
790 _, err := s.exprs[i].TypeCheck(ctx, types.Any)
791 return err
792 }
793 // If we dont want to error on args, avoid type checking them without a desired type.
794 s.typedExprs[i] = StripParens(s.exprs[i]).(*Placeholder)
795 }
796 return nil
797}
798
799// checkReturn checks the number of remaining overloaded function
800// implementations.

Callers 2

typeCheckOverloadedExprsFunction · 0.85
checkReturnFunction · 0.85

Calls 3

WrapfFunction · 0.92
StripParensFunction · 0.85
TypeCheckMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…