missing middle expression, and fix a codegen bug where we didn't correctly promote the condition to the right result type. This fixes PR1824. llvm-svn: 44322