Fix panic on deriving a nullary typeclass (#7959)