|
256 | 256 | <type>anyarray</type> positions must be an array whose elements are
|
257 | 257 | the same type appearing in the <type>anyelement</type> positions.
|
258 | 258 | Similarly, if there are positions declared <type>anyrange</type>
|
259 |
| - and others declared <type>anyelement</type>, the actual range type in |
260 |
| - the <type>anyrange</type> positions must be a range whose subtype is |
261 |
| - the same type appearing in the <type>anyelement</type> positions. |
| 259 | + and others declared <type>anyelement</type> or <type>anyarray</type>, |
| 260 | + the actual range type in the <type>anyrange</type> positions must be a |
| 261 | + range whose subtype is the same type appearing in |
| 262 | + the <type>anyelement</type> positions and the same as the element type |
| 263 | + of the <type>anyarray</type> positions. |
262 | 264 | <type>anynonarray</type> is treated exactly the same as <type>anyelement</type>,
|
263 | 265 | but adds the additional constraint that the actual type must not be
|
264 | 266 | an array type.
|
|
289 | 291 | will only accept arrays of enum types.
|
290 | 292 | </para>
|
291 | 293 |
|
| 294 | + <para> |
| 295 | + In most cases, the parser can infer the actual data type for a |
| 296 | + polymorphic result type from arguments that are of a different |
| 297 | + polymorphic type; for example <type>anyarray</type> can be deduced |
| 298 | + from <type>anyelement</type> or vice versa. The exception is that a |
| 299 | + polymorphic result of type <type>anyrange</type> requires an argument |
| 300 | + of type <type>anyrange</type>; it cannot be deduced |
| 301 | + from <type>anyarray</type> or <type>anyelement</type> arguments. This |
| 302 | + is because there could be multiple range types with the same subtype. |
| 303 | + </para> |
| 304 | + |
292 | 305 | <para>
|
293 | 306 | Note that <type>anynonarray</type> and <type>anyenum</type> do not represent
|
294 | 307 | separate type variables; they are the same type as
|
|
0 commit comments