Type-II Dirac semimetals in the YPd$_2$Sn class