ISTM this is probably wrong: we need such a domain to act like its base type for matching purposes. There is an analogous problem with a domain over an array type failing to match ANYARRAY; conversely, such a domain is considered to match ANYNONARRAY which it likely should not.
Comments? If this is agreed to be a bug, should we consider back-patching it? (I'd vote not, I think, because the behavioral change could conceivably break some apps that work now.)