Taking the LHS type when a temporary result value was needed lead to bad code being generated if we get a tyRef. Fixes #9098