Note: information on this page refers to Ceylon 1.0, not to the current release.
?.
(null-safe method) operator
The left-associative, binary ?.
operator is used to invoke a method
as if its right-hand operand were not null
.
Usage
void m(Integer? num) {
Integer?(Integer) plus = num?.plus;
}
Description
Definition
See the language specification for more details.
Polymorphism
The ?.
operator is not polymorphic.
Type
The result type of the lhs?.rhs
operator is the callable type of the right
hand operand, with the return type replaced by its corresponding optional type.
See also
-
?
(default) operator -
?.
in the language specification. - operator precedence in the language specification