Deal with noSpec in coreExprToPmLit
Tickets: #25926 (closed) #27124 (closed)
This MR makes two separate changes relating to GHC.HsToCore.Pmc.Solver.Types.coreExprAsPmLit:
- Commit 7124e4ad mistakenly marked deferred errors as non-canonical, which led to the introduction of
nospecwrappers in the generated Core. This reverts that accident by declaring deferred errors as being canonical, avoiding spuriousnospecwrapping. - Look through magic identity-like
Ids such asnospec,inlineandlazyincoreExprAsPmLit, just like Core Prep does. There might genuinely be incoherent evidence, but that shouldn't obstruct the pattern match checker.
Only the change in (1) is strictly required to fix the reported bugs, but implementing (2) prevents similar bugs from occurring (see test case T27124a).
Edited by sheaf