|
225 | 225 | <type>anyarray</type> positions must be an array whose elements are
|
226 | 226 | the same type appearing in the <type>anyelement</type> positions.
|
227 | 227 | Similarly, if there are positions declared <type>anyrange</type>
|
228 |
| - and others declared <type>anyelement</type>, the actual range type in |
229 |
| - the <type>anyrange</type> positions must be a range whose subtype is |
230 |
| - the same type appearing in the <type>anyelement</type> positions. |
231 |
| - <type>anynonarray</> is treated exactly the same as <type>anyelement</>, |
| 228 | + and others declared <type>anyelement</type> or <type>anyarray</type>, |
| 229 | + the actual range type in the <type>anyrange</type> positions must be a |
| 230 | + range whose subtype is the same type appearing in |
| 231 | + the <type>anyelement</type> positions and the same as the element type |
| 232 | + of the <type>anyarray</type> positions. |
| 233 | + <type>anynonarray</type> is treated exactly the same as <type>anyelement</type>, |
232 | 234 | but adds the additional constraint that the actual type must not be
|
233 | 235 | an array type.
|
234 | 236 | <type>anyenum</> is treated exactly the same as <type>anyelement</>,
|
|
258 | 260 | will only accept arrays of enum types.
|
259 | 261 | </para>
|
260 | 262 |
|
| 263 | + <para> |
| 264 | + In most cases, the parser can infer the actual data type for a |
| 265 | + polymorphic result type from arguments that are of a different |
| 266 | + polymorphic type; for example <type>anyarray</type> can be deduced |
| 267 | + from <type>anyelement</type> or vice versa. The exception is that a |
| 268 | + polymorphic result of type <type>anyrange</type> requires an argument |
| 269 | + of type <type>anyrange</type>; it cannot be deduced |
| 270 | + from <type>anyarray</type> or <type>anyelement</type> arguments. This |
| 271 | + is because there could be multiple range types with the same subtype. |
| 272 | + </para> |
| 273 | + |
261 | 274 | <para>
|
262 | 275 | Note that <type>anynonarray</> and <type>anyenum</> do not represent
|
263 | 276 | separate type variables; they are the same type as
|
|
0 commit comments