()
| 84 | } |
| 85 | |
| 86 | func (o ScalarOperation) validate() error { |
| 87 | if err := o.LHS.validate(); err != nil { |
| 88 | return err |
| 89 | } |
| 90 | if err := o.RHS.validate(); err != nil { |
| 91 | return err |
| 92 | } |
| 93 | |
| 94 | if o.Op == OpNotExists || o.Op == OpExists { |
| 95 | return fmt.Errorf("illegal operation for the given type: %s", o.String()) |
| 96 | } |
| 97 | |
| 98 | lhsT := o.LHS.impliedType() |
| 99 | rhsT := o.RHS.impliedType() |
| 100 | if !lhsT.isMatchingOperand(rhsT) { |
| 101 | return fmt.Errorf("binary operations must operate on the same type: %s", o.String()) |
| 102 | } |
| 103 | |
| 104 | if !o.Op.binaryTypesValid(lhsT, rhsT) { |
| 105 | return fmt.Errorf("illegal operation for the given types: %s", o.String()) |
| 106 | } |
| 107 | |
| 108 | return nil |
| 109 | } |
| 110 | |
| 111 | func (a Aggregate) validate() error { |
| 112 | if a.e == nil { |
nothing calls this directly
no test coverage detected