Null-safe property access

A property path expression in Gosu is a series of property accesses in series, for example x.P1.P2.P3. There are two different operators you can use in Gosu to get property values:

  • The standard period operator (.), which can access properties or invoke methods. The standard period operator is only null-safe for properties, and not for method invocations.
  • The null-safe period operator (?.), which can access properties or invoke methods in a null-safe way. For properties, this is the same as the standard period operator. For methods, you must use this operator if you want a null-safe method invocation.

See also