It is wrong to swap the order of these two types.  The pat_ty should be be the supertype. If the problem is the error message is coming out incorrect, there is another way to solve it, though it's mildly more involved.