We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently, Optional chaining on Object fields work well:
MyObj?.Field1 ?? "default"
However, one cannot make an optional call to a method on an object:
// this panics when MyObj is nil MyObj?.Method1() ?? "default"
// this does not compile MyObj?.Method1?.() ?? "default"
So one is forced to write this, which works but is more verbose. Especially when MyObj is actually a long expression:
MyObj
MyObj != nil ? MyObj.Method1() : "default"
?.() should be a valid optional function call syntax
?.()
The text was updated successfully, but these errors were encountered:
antonmedv
No branches or pull requests
Currently, Optional chaining on Object fields work well:
However, one cannot make an optional call to a method on an object:
So one is forced to write this, which works but is more verbose. Especially when
MyObj
is actually a long expression:Expected Behavior
?.()
should be a valid optional function call syntaxThe text was updated successfully, but these errors were encountered: