blitz-foundation / monkey2

zlib License
3 stars 0 forks source link

Feature request: Safe navigation operator for Null checking (MyObject?.SomeProperty ) #23

Open Pharmhaus-2 opened 5 years ago

Pharmhaus-2 commented 5 years ago

Original Author: Difference

It would be nice to have the "Elvis" operator in MX2 to simplify property checking:

Current syntax examples: `If Myobject And Myobject.SomeNullableProperty

Local myVar:Float If Myobject myVar = Myobject.AFloatProperty`

New Syntax examples: `If Myobject?.SomeNullableProperty

Local myVar:= Myobject?.AFloatProperty`