Polymorphic this Typing seems like a major change with many possible corner cases. I think Dart .. operator is a better solution newModel.setupBase().setupAdvanced(); becomes newModel..setupBase()..setupAdvanced();
That assumes setupBase(), etc are either void-returning or return the this-instance (newModel). It won't work if each method returns a new instance, such as methods of immutable collections. Edit: Since this is hard to google for, this is called the "cascade operator". The given example is equivalent to: newModel.setupBase(); newModel.setupAdvanced(); That is, it ignores the result of the method and runs the remainin…
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.
http://news.dartlang.org/2012/02/method-cascades-in-dart-pos...
Since the return value is ignored, it's only useful for methods with side-effects.