Possible fix for fluent interfaces warning

When using a fluent interface, the maximum chained references warning will be shown.
I think this can fix this situation.

It detected if sequential references have the same return type. If they do, they are discarded.