This cannot happen; we only write those fields for sm1 shaders, which can only be pixel or vertex.
That's true, but it's perhaps also more fragile than it needs to be, since that depends on those being the first two enum elements.
Yes, that's true. I'll send a patch to make it less fragile.