TypeCheck implements the Expr interface.
( ctx context.Context, semaCtx *SemaContext, desired *types.T, )
| 1216 | |
| 1217 | // TypeCheck implements the Expr interface. |
| 1218 | func (expr *RangeCond) TypeCheck( |
| 1219 | ctx context.Context, semaCtx *SemaContext, desired *types.T, |
| 1220 | ) (TypedExpr, error) { |
| 1221 | leftFromTyped, fromTyped, _, _, err := typeCheckComparisonOp(ctx, semaCtx, GT, expr.Left, expr.From) |
| 1222 | if err != nil { |
| 1223 | return nil, err |
| 1224 | } |
| 1225 | leftToTyped, toTyped, _, _, err := typeCheckComparisonOp(ctx, semaCtx, LT, expr.Left, expr.To) |
| 1226 | if err != nil { |
| 1227 | return nil, err |
| 1228 | } |
| 1229 | // Ensure that the boundaries of the comparison are well typed. |
| 1230 | _, _, _, _, err = typeCheckComparisonOp(ctx, semaCtx, LT, expr.From, expr.To) |
| 1231 | if err != nil { |
| 1232 | return nil, err |
| 1233 | } |
| 1234 | expr.Left, expr.From = leftFromTyped, fromTyped |
| 1235 | expr.leftTo, expr.To = leftToTyped, toTyped |
| 1236 | expr.typ = types.Bool |
| 1237 | return expr, nil |
| 1238 | } |
| 1239 | |
| 1240 | // TypeCheck implements the Expr interface. |
| 1241 | func (expr *Subquery) TypeCheck(_ context.Context, sc *SemaContext, _ *types.T) (TypedExpr, error) { |
nothing calls this directly
no test coverage detected