| 1757 | } |
| 1758 | |
| 1759 | func cmpOpFixups(cmpOps map[ComparisonOperator]cmpOpOverload) map[ComparisonOperator]cmpOpOverload { |
| 1760 | // Array equality comparisons. |
| 1761 | for _, t := range types.Scalar { |
| 1762 | cmpOps[EQ] = append(cmpOps[EQ], &CmpOp{ |
| 1763 | LeftType: types.MakeArray(t), |
| 1764 | RightType: types.MakeArray(t), |
| 1765 | Fn: cmpOpScalarEQFn, |
| 1766 | }) |
| 1767 | cmpOps[LE] = append(cmpOps[LE], &CmpOp{ |
| 1768 | LeftType: types.MakeArray(t), |
| 1769 | RightType: types.MakeArray(t), |
| 1770 | Fn: cmpOpScalarLEFn, |
| 1771 | }) |
| 1772 | cmpOps[LT] = append(cmpOps[LT], &CmpOp{ |
| 1773 | LeftType: types.MakeArray(t), |
| 1774 | RightType: types.MakeArray(t), |
| 1775 | Fn: cmpOpScalarLTFn, |
| 1776 | }) |
| 1777 | |
| 1778 | cmpOps[IsNotDistinctFrom] = append(cmpOps[IsNotDistinctFrom], &CmpOp{ |
| 1779 | LeftType: types.MakeArray(t), |
| 1780 | RightType: types.MakeArray(t), |
| 1781 | Fn: cmpOpScalarIsFn, |
| 1782 | NullableArgs: true, |
| 1783 | }) |
| 1784 | } |
| 1785 | |
| 1786 | for op, overload := range cmpOps { |
| 1787 | for i, impl := range overload { |
| 1788 | casted := impl.(*CmpOp) |
| 1789 | casted.types = ArgTypes{{"left", casted.LeftType}, {"right", casted.RightType}} |
| 1790 | cmpOps[op][i] = casted |
| 1791 | } |
| 1792 | } |
| 1793 | |
| 1794 | return cmpOps |
| 1795 | } |
| 1796 | |
| 1797 | // cmpOpOverload is an overloaded set of comparison operator implementations. |
| 1798 | type cmpOpOverload []overloadImpl |