Replace unnecessary case in switch with assert.