Fix a typecheck regression with constant borrowed pointers in patterns

Change the eqtype relationship to be a suptype relationship instead.

Fixes #18350.
Fixes #18352.