Fix a long-standing latent bug (and the build): check res_ty not sig_ty