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)
| 777 | // defaultTypeCheck type checks the constant and placeholder expressions without a preference |
| 778 | // and adds them to the type checked slice. |
| 779 | func 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. |
no test coverage detected
searching dependent graphs…