Fixes #1011 -- exit earlier for differently-typed constructors in isEqual.