Indirect checking for return_type through an extra function (#26836)
Compiler.return_type is a bit of an odd beast because we basically treat
it like a built-in, but it's defined in the compiler. When working on
inference, it can be useful to load a second copy of inference with
the new changes (e.g. to test changes before the changes are capable
of running correctly on all input). This works quite well, but was
causing problems with return type, because Base's notion of
return_type and the second inference copy's notion of return_type
were different. This patch adds a simple is_return_type(f) predicate
that we can overload in our second inference copy in order to make it
recognize both Core.Compiler.return_type and return_type (from
the second copy's perspective as the return_type builtin).