QL HB: Explain use of cast [SD-3865]

This commit is contained in:
Shati Patel
2019-09-09 15:47:04 +01:00
parent 4f2c9fa3cb
commit f5de1dc999

View File

@@ -147,7 +147,11 @@ predicate from the :ref:`above <defining-class>` class::
1.(OneTwoThree).getAString()
This call returns the results ``"One, two or three: 1"``.
This call returns the result ``"One, two or three: 1"``.
The expression ``(OneTwoThree)`` is a :ref:`cast <casts>`. It ensures that ``1`` has type
``OneTwoThree`` instead of just ``int``. Therefore, it has access to the member predicate
``getAString()``.
Member predicates are especially useful because you can chain them together. For example, you
can use ``toUpperCase()``, a built-in function defined for ``string``::