Fix Issue 9356 - -inline with inout and append generates wrong code

Force the result expression from inlining a function to match the type of the call expression
Use if/else if/else assert(0) pattern to catch any appends that do not fit element or array append