|
288 | 288 | </entry>
|
289 | 289 | </row>
|
290 | 290 |
|
| 291 | + <row> |
| 292 | + <entry><type>anymultirange</type></entry> |
| 293 | + <entry>Simple</entry> |
| 294 | + <entry>Indicates that a function accepts any multirange data type |
| 295 | + (see <xref linkend="rangetypes"/>) |
| 296 | + </entry> |
| 297 | + </row> |
| 298 | + |
291 | 299 | <row>
|
292 | 300 | <entry><type>anycompatible</type></entry>
|
293 | 301 | <entry>Common</entry>
|
|
319 | 327 | with automatic promotion of multiple arguments to a common data type
|
320 | 328 | </entry>
|
321 | 329 | </row>
|
| 330 | + |
| 331 | + <row> |
| 332 | + <entry><type>anycompatiblemultirange</type></entry> |
| 333 | + <entry>Common</entry> |
| 334 | + <entry>Indicates that a function accepts any multirange data type, |
| 335 | + with automatic promotion of multiple arguments to a common data type |
| 336 | + </entry> |
| 337 | + </row> |
322 | 338 | </tbody>
|
323 | 339 | </tgroup>
|
324 | 340 | </table>
|
|
346 | 362 | position declared as <type>anyarray</type> can have any array data type,
|
347 | 363 | but similarly they must all be the same type. And similarly,
|
348 | 364 | positions declared as <type>anyrange</type> must all be the same range
|
349 |
| - type. Furthermore, if there are |
| 365 | + type. Likewise for <type>anymultirange</type>. |
| 366 | + </para> |
| 367 | + |
| 368 | + <para> |
| 369 | + Furthermore, if there are |
350 | 370 | positions declared <type>anyarray</type> and others declared
|
351 | 371 | <type>anyelement</type>, the actual array type in the
|
352 | 372 | <type>anyarray</type> positions must be an array whose elements are
|
353 | 373 | the same type appearing in the <type>anyelement</type> positions.
|
354 |
| - Similarly, if there are positions declared <type>anyrange</type> |
355 |
| - and others declared <type>anyelement</type> or <type>anyarray</type>, |
356 |
| - the actual range type in the <type>anyrange</type> positions must be a |
357 |
| - range whose subtype is the same type appearing in |
358 |
| - the <type>anyelement</type> positions and the same as the element type |
359 |
| - of the <type>anyarray</type> positions. |
360 | 374 | <type>anynonarray</type> is treated exactly the same as <type>anyelement</type>,
|
361 | 375 | but adds the additional constraint that the actual type must not be
|
362 | 376 | an array type.
|
|
365 | 379 | be an enum type.
|
366 | 380 | </para>
|
367 | 381 |
|
| 382 | + <para> |
| 383 | + Similarly, if there are positions declared <type>anyrange</type> |
| 384 | + and others declared <type>anyelement</type> or <type>anyarray</type>, |
| 385 | + the actual range type in the <type>anyrange</type> positions must be a |
| 386 | + range whose subtype is the same type appearing in |
| 387 | + the <type>anyelement</type> positions and the same as the element type |
| 388 | + of the <type>anyarray</type> positions. |
| 389 | + If there are positions declared <type>anymultirange</type>, |
| 390 | + their actual multirange type must contain ranges matching parameters declared |
| 391 | + <type>anyrange</type> and base elements matching parameters declared |
| 392 | + <type>anyelement</type> and <type>anyarray</type>. |
| 393 | + </para> |
| 394 | + |
368 | 395 | <para>
|
369 | 396 | Thus, when more than one argument position is declared with a polymorphic
|
370 | 397 | type, the net effect is that only certain combinations of actual argument
|
|
420 | 447 | Selection of the common type considers the actual types
|
421 | 448 | of <type>anycompatible</type> and <type>anycompatiblenonarray</type>
|
422 | 449 | inputs, the array element types of <type>anycompatiblearray</type>
|
423 |
| - inputs, and the range subtypes of <type>anycompatiblerange</type> |
| 450 | + inputs, the range subtypes of <type>anycompatiblerange</type> inputs, |
| 451 | + and the multirange subtypes of <type>anycompatiablemultirange</type> |
424 | 452 | inputs. If <type>anycompatiblenonarray</type> is present then the
|
425 | 453 | common type is required to be a non-array type. Once a common type is
|
426 | 454 | identified, arguments in <type>anycompatible</type>
|
|
431 | 459 |
|
432 | 460 | <para>
|
433 | 461 | Since there is no way to select a range type knowing only its subtype,
|
434 |
| - use of <type>anycompatiblerange</type> requires that all arguments |
435 |
| - declared with that type have the same actual range type, and that that |
436 |
| - type's subtype agree with the selected common type, so that no casting |
437 |
| - of the range values is required. As with <type>anyrange</type>, use |
438 |
| - of <type>anycompatiblerange</type> as a function result type requires |
439 |
| - that there be an <type>anycompatiblerange</type> argument. |
| 462 | + use of <type>anycompatiblerange</type> and/or |
| 463 | + <type>anycompatiblemultirange</type> requires that all arguments declared |
| 464 | + with that type have the same actual range and/or multirange type, and that |
| 465 | + that type's subtype agree with the selected common type, so that no casting |
| 466 | + of the range values is required. As with <type>anyrange</type> and |
| 467 | + <type>anymultirange</type>, use of <type>anycompatiblerange</type> and |
| 468 | + <type>anymultirange</type> as a function result type requires that there be |
| 469 | + an <type>anycompatiblerange</type> or <type>anycompatiblemultirange</type> |
| 470 | + argument. |
440 | 471 | </para>
|
441 | 472 |
|
442 | 473 | <para>
|
|
0 commit comments