When parsing a ternary expression, we would parse the middle and the last
components of the expression. If there was a typo in both, we would only
run the typo correction once. Normally, this would be fine, but, when Sema
would be destructed in an Asserts build, we would assert that a delayed typo was
not handled. This was caused by the fact that the RHS would evaluate as valid
as a TypoExpr would be returned via the ExprResult, and invalid simply ensures
that an expression is present. Peek into the result and perform the handling
that we would reserve for the invalid type.
Resolves PR265598.