(call *ast.CallExpr, name string, inType super.Type)
| 868 | } |
| 869 | |
| 870 | func (t *translator) maybeSubqueryCall(call *ast.CallExpr, name string, inType super.Type) (*sem.SubqueryExpr, super.Type) { |
| 871 | decl, _ := t.scope.lookupOp(name) |
| 872 | if decl == nil || decl.bad { |
| 873 | return nil, nil |
| 874 | } |
| 875 | userOp, typ := t.userOp(call.Loc, decl, call.Args, inType) |
| 876 | // When a user op is encountered inside an expression, we turn it into a |
| 877 | // subquery operating on a single-shot "this" value unless it's uncorrelated |
| 878 | // (i.e., starts with a from), in which case we put the uncorrelated body |
| 879 | // in the subquery without the correlating values logic. This is controlled |
| 880 | // via the Correlated flag. |
| 881 | return &sem.SubqueryExpr{ |
| 882 | Node: call, |
| 883 | Array: false, |
| 884 | Correlated: isCorrelated(userOp), |
| 885 | Body: userOp, |
| 886 | }, typ |
| 887 | } |
| 888 | |
| 889 | func (t *translator) semMapCall(call *ast.CallExpr, args []sem.Expr, argTypes []super.Type) (sem.Expr, super.Type) { |
| 890 | if len(args) != 2 { |
no test coverage detected