2 ms·
>This is Incorrect, it doesn't assume anything. Dart's method cascades just returns the receiver, it doesn't matter what the method returns, it's value is ignor
by Arnavion 11y ago
>This is Incorrect, it doesn't assume anything. Dart's method cascades just returns the receiver, it doesn't matter what the method returns, it's value is ignored and receiver is returned instead.
... which would only be useful if the method was void-returning or returned the this-instance, i.e., it didn't return a new instance and left the LHS unmodified.
- deleted 11y ago[deleted]
- deleted 11y ago[deleted]
- mythz 11y ago> which would only be useful if the method was void-returning or returned the this-instance Simply untrue, there are plenty of times methods have side-effects that return something other than void or itself, e.g: - Incrementing a value and returning the current value - Inserting or Updating rows and returning the number of rows affected - Setting an entry and returning whether there was an existing entry or not
- Arnavion 11y agoThe example I was responding to was about "setupBase" and "setupAdvanced"...