The code was pretending to be doing something useful with vectors, but really it was doing nothing: the element type of a vector is always a scalar type, so constWithPadding would always just return the input constant.
Split off from D75661 so it can be reviewed separately.
While I'm here, also add testcase to show missing vector handling.