If the \left( and \right( commands are unmatched, it gives an error when compiled. This does not do anything to make sure the delimiters are of the same type though. A \left[ can be closed with a \right|, but this is actually a desirable feature (and a practically necessary one ...