Don't panic on 'no skolem info' and add failing tests
We instead print a big ugly warning so that the user reports a bug:
WARNING:
No skolem info - we could not find the origin of the following variables [a_aws[sk:1]]
This should not happen, please report it as a bug following the instructions at:
https://gitlab.haskell.org/ghc/ghc/wikis/report-a-bug
Call stack:
CallStack (from HasCallStack):
pprTraceUserWarning, called at compiler/GHC/Tc/Errors.hs:2982:7 in ghc:GHC.Tc.Errors
T10949.hs:6:13: error:
• Found hole: _ :: a
Where: ‘a’ is a (rigid, skolem) type variable
of unknown origin
bound at T10949.hs:5:1-11
• In the Template Haskell quotation [|| _ ||]
In the expression: [|| _ ||]
In the Template Haskell splice $$([|| _ ||])
• Relevant bindings include
x :: a (bound at T10949.hs:6:3)
m :: a -> a (bound at T10949.hs:6:1)
Valid hole fits include x :: a (bound at T10949.hs:6:3)
|
6 | m x = $$([||_||])
| ^
Also improved the error message of unknown skolems a bit, including the definition SrcSpan
.
Adds expect_broken
tests for #19752 (closed), #20063 (closed), #19760 (closed), #19482 (closed), #10946 (closed)
Also adds a test for #16135 which is broken with debugged compilers.