Panic in `lookupIdSubst` when making ModDetails/ModIface by hand
I'm synthesizing a `ModDetails`/`ModIface` directly without any original Haskell source code, and running into a problem where GHC fails during `Core` generation with an internal panic. Also, note the warning (when GHC is compiled with `-DDEBUG`) that also only shows up when the instance is used:
```
Loading module Class
Registering module Class
Registering module Enums
Loading module A
Registering module A
WARNING:
Glomming in A: [EeR :-> Once1]
Call stack:
CallStack (from HasCallStack):
warnPprTrace, called at compiler/GHC/Core/Opt/OccurAnal.hs:85:5 in ghc-lib-0.20211130-7QA7vLTw0OYJmMsraoHe3v:GHC.Core.Opt.OccurAnal
hello: panic! (the 'impossible' happened)
GHC version 9.3.20211130:
lookupIdSubst
$fMyClassFoo
InScope {}
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/GHC/Utils/Panic.hs:181:37 in ghc-lib-0.20211130-7QA7vLTw0OYJmMsraoHe3v:GHC.Utils.Panic
pprPanic, called at compiler/GHC/Core/Subst.hs:260:17 in ghc-lib-0.20211130-7QA7vLTw0OYJmMsraoHe3v:GHC.Core.Subst
lookupIdSubst, called at compiler/GHC/Core/SimpleOpt.hs:240:10 in ghc-lib-0.20211130-7QA7vLTw0OYJmMsraoHe3v:GHC.Core.SimpleOpt
simple_opt_expr, called at compiler/GHC/Core/SimpleOpt.hs:225:5 in ghc-lib-0.20211130-7QA7vLTw0OYJmMsraoHe3v:GHC.Core.SimpleOpt
Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug
```
To reproduce:
1. Put attached [`Class.hs`](/uploads/a169537e55c9d38ecba15bec8be30a51/Class.hs) and [`A.hs`](/uploads/ce3d33e1eb981c405b9703bb63a4df08/A.hs) files into `input/` directory
2. Edit line 48 of `Main.hs` to point to your Hadrian stage1 directory
3. Run [`Main.hs`](/uploads/3b76b1f06548482a143f1070c495fb29/Main.hs) and observe the error message
issue