Note: information on this page refers to Ceylon 1.1, not to the current release.
?.
(null-safe attribute) operator
The left-associative, binary ?.
operator is used to access an attribute
as if its right-hand operand were not null
.
Usage
void m(Integer? num) {
Integer? int = num?.positiveValue;
}
Description
Definition
The meaning of ?.
is defined as follows:
if (exists lhs) lhs.member else null
Polymorphism
The ?.
operator is not polymorphic.
Type
The result type of the lhs?.rhs
operator is the optional type of the right
hand operand.
See also
-
else
(default) operator -
?.
in the language specification. - operator precedence in the language specification