D-Programming-Language/dmd — pull request #2269 by yebblies (2013-06-28 13:50:39+00:00)
Title: 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.

eg the inlined expression from
`inout(char)[] bar (inout(char)[] a) { return a; }`
called with:
`bar("abc")`
should be
`immutable(char)[]`
but the type of the actual return expression is
`inout(char)[]`.

Coupled with an optimistic if/else in e2ir, this generates wrong code.