Add error message for anonymous impl for types not declared in the current module

Followup to RFC 57.

Fixes #7607
Fixes #8767
Fixes #12729
Fixes #15060
Ah ok! My ideal wording would be something like:

```
//~ ERROR: cannot define methods on a non-existent type
```

but if resolve right now doesn't have that information we can continue to improve the error message later on!